#36212: (請問)3 0 80 75那行錯,但在自己電腦試是對的


shih931024@gmail.com (tusk4)

School : No School
ID : 149354
IP address : [61.227.220.30]
Last Login :
2023-07-15 15:56:48
a148. You Cannot Pass?! | From: [61.227.215.46] | Post Date : 2023-07-10 19:35

#include<iostream>
using namespace std;
int main() {
    double a, b;
    int sum = 0,i;
    while (cin >> a) {
        for (i = 0; i < a; i++) {
            cin >> b;
            sum += b;
        }
        if (sum > 59*a) {
            cout << "no"<<endl;
        }
        else {
            cout << "yes" << endl;
        }
    }
}

 
#36220: Re: (請問)3 0 80 75那行錯,但在自己電腦試是對的


cges30901 (cges30901)

School : No School
ID : 30877
IP address : [223.137.45.19]
Last Login :
2024-06-13 21:42:20
a148. You Cannot Pass?! | From: [118.160.195.54] | Post Date : 2023-07-11 13:13

#include
using namespace std;
int main() {
    double a, b;
    int sum = 0,i;
    while (cin >> a) {
        for (i = 0; i < a; i++) {
            cin >> b;
            sum += b;
        }
        if (sum > 59*a) {
            cout << "no"<        }
        else {
            cout << "yes" << endl;
        }
    }
}


我怕被質疑貼程式碼,所以傳私人訊息給你了

 
ZeroJudge Forum