1 条题解
-
0
C :
#include <stdio.h> int main (void) { int T,i; double a[5]={0}; double b; double avg; scanf("%d",&T); while(T--){ scanf("%lf",&b); for(i=0;i<5;i++){ scanf("%lf",&a[i]); } avg=(a[0]+a[1]+a[2]+a[3]+a[4])/5.0; if(b>=avg){ printf("Xiaoming is full of confidence\n"); } else{ printf("Xiaoming is panic to death\n"); } } return 0; }
C++ :
#include <iostream> #include <fstream> using namespace std; int main() { // ifstream cin; // ofstream cout; // cin.open("f.in"); // cout.open("f.out"); int testcase; cin>>testcase; while(testcase--) { double tmp,avg=0; double tar,res=0; cin>>tar; for(int i=0;i<5;i++) { cin>>tmp; res+=tmp; } avg=res/5.0; if(avg<=tar) { cout<<"Xiaoming is full of confidence"<<endl; } else { cout<<"Xiaoming is panic to death"<<endl; } } return 0; }
- 1
信息
- ID
- 3373
- 时间
- 1000ms
- 内存
- 64MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者