#include<stdio.h> int main(){ int n = 0; int i = 0;//计正数 int j = 0;//计负数 int x = 10;//数字总个数 while(x) { scanf("%d ",&n); if(n > 0) i++; if(n < 0) j++; x--; }; printf("positive:%d\n",i); printf("negative:%d\n",j); return 0; }
#include<stdio.h> int main(){ int n = 0; int i = 0;//计正数 int j = 0;//计负数 int x = 10;//数字总个数 while(x) { scanf("%d ",&n); if(n > 0) i++; if(n < 0) j++; x--; }; printf("positive:%d\n",i); printf("negative:%d\n",j); return 0; }