#41648: c++解法+注意事項


yp11351280@yphs.tp.edu.tw (810-43韓睿哲)


記得要把變數歸零喲!還有,可以用(總分  是否>  59*科目數)去判斷有沒有被當掉。

#include <iostream>
using namespace std;
int main()
{
    int a;
double c, d=0;
    while(cin>>a){
    for(int b=0;b<a;b++)
    {
        cin>>c;
d+=c;
}
(d>59*a)?cout<<"no"<<endl:cout<<"yes"<<endl;
d=0;
}
return 0;
}