Submission #18479


Source Code Expand

Copy
#include <iostream>
#include <cstdlib>

using namespace std;

int main( void )
{
  int N, point = 0;
  char eval[100];
  double GPA;
  
  cin >> N;
  cin >> eval;
  
  for( int i = 0; i < N; i++ )
    {
      if( eval[i] == 'A' ) point += 4;
      else if( eval[i] == 'B' ) point += 3;
      else if( eval[i] == 'C' ) point += 2;
      else if( eval[i] == 'D' ) point += 1;
      else if( eval[i] == 'F' ) point += 0;
    }

  GPA = point / (double)N;
  cout << GPA << endl;
  
  return 0;
}

Submission Info

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

Compile Error

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