迴圈

輸入科目

輸入分數

依條件輸出

 

 

#include <iostream>

using namespace std;

 

 

void beFailed(int n);

int main()
{
    int n;

    while(cin >> n)
        beFailed(n);
        
    return 0;
}

void beFailed(int n)
{
    int grade[n], total = 0;

    for(int i = 0; i<n; i++)
        cin >> grade[i];

    for(int i = 0; i<n; i++)
        total += grade[i];

    if(total > 59*n)
        cout << "no\n";
    else
        cout << "yes\n";
}

arrow
arrow
    全站熱搜

    大神(偽) 發表在 痞客邦 留言(0) 人氣()