1 solutions
-
0
C :
#include<stdio.h> int main() { int high=0,mid=0,low=0; int x; while(scanf("%d",&x), x>0) { if(x >= 85) high++; else if(x >= 60) mid++; else low++; } printf(">=85:%d\n60-84:%d\n<60:%d\n",high,mid,low); return 0; }C++ :
#include<iostream> using namespace std; int main() { int x,a=0,b=0,c=0; while (cin>>x && x>0) if (x>=85) a++; else if(x>=60) b++; else c++; cout<<">=85:"<<a<<endl; cout<<"60-84:"<<b<<endl; cout<<"<60:"<<c<<endl; return 0; }
- 1
Information
- ID
- 16801
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- (None)
- # Submissions
- 0
- Accepted
- 0
- Uploaded By