1 条题解
-
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
信息
- ID
- 1938
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- (无)
- 递交数
- 0
- 已通过
- 0
- 上传者