Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///
- // main.c
- // ht02_01
- //
- // Created by Артем Барышев on 19.09.2018.
- // Copyright © 2018 Артем Барышев. All rights reserved.
- //
- #include <stdio.h>
- #include <stdlib.h>
- int
- main(int argc, char *argv[])
- {
- long long sum_minus = 0;
- long long sum_plus = 0;
- for (int i = 1; i < argc; ++i) {
- long long now = atoi(argv[i]);
- if (now < 0) {
- sum_minus += now;
- }
- else {
- sum_plus += now;
- }
- }
- printf("%lld\n%lld\n", sum_plus, sum_minus);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement