Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
52730 | yuboyuan | 求平均年龄 | C++ | Wrong Answer | 0 MS | 244 KB | 329 | 2024-10-12 20:57:45 |
#include<bits/stdc++.h> using namespace std; int main() { int n,x,s,i=1; bool a=1; cin>>n; while(i<=n) { cin>>x; a=a&&(x>=15)&&(x<=25); s+=x; i++; } if(a&&(n>=1)&&(n<=100)) { cout<<fixed<<setprecision(2)<<(float)s/n; } return 0; }