Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int num, sumPosi = 0, sumNega = 0, posi = 0, nega = 0;
- while(scanf("%d", &num) && num < 100 && num > -100) {
- if(num > 0) {
- sumPosi = sumPosi + num;
- posi++;
- }
- else if(num < 0) {
- sumNega = sumNega + num;
- nega++;
- }
- }
- printf("%d %d %d %d", nega, posi, sumNega, sumPosi);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement