Submission #18411


Source Code Expand

Copy
#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

int main(int argc, char const* argv[])
{
    int N;
    cin >> N;
    string s;
    cin >> s;
    int score;
    int length = N;
    for (int i=0; i<N; i++) {
        switch (s[i]) {
            case 'A':
                score += 4;
                break;
            case 'B':
                score += 3;
                break;
            case 'C':
                score += 2;
                break;
            case 'D':
                score += 1;
                break;
            default:
                break;
        }
    }
    cout << setprecision(10) << score /(double)length << endl;
    return 0;
}

Submission Info

Submission Time
Task A - GPA計算
User yusui
Language C (GCC 4.4.7)
Score 0
Code Size 727 Byte
Status CE

Compile Error

./Main.c:1: fatal error: iostream: No such file or directory
compilation terminated.