Submission #18992


Source Code Expand

Copy
  1 #include<stdio.h>
  2 
  3 int main(void){
  4     char c;
  5     int s[5]={0};
  6     double ave=0;
  7     int i,n;
  8     scanf("%d",&n);
  9     for(i=0;i<n+1;i++){
 10         scanf("%c",&c);
 11         s[ c - 'A'] ++;
 12         //printf("%c",c);
 13     }
 14     for(i=0;i<5;i++){
 15         //printf("%d ",s[i]);
 16         ave += s[i]*(4-i);
 17     }
 18     printf("%f\n",ave/n);
 19     return 0;
 20 }
~                                                                               
~                                                                               
~                                                                               
"test.c" 20L, 347C                                            1,1           All

Submission Info

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

Compile Error

./Main.c:1: error: expected identifier or ‘(’ before numeric constant
./Main.c:1: error: stray ‘#’ in program
./Main.c:21: error: expected identifier or ‘(’ before ‘~’ token
./Main.c:24: error: invalid suffix "C" on integer constant