답안 #15007

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
15007 2015-07-09T21:39:13 Z tncks0121 뚊 (kriii3_EE) C
컴파일 오류
0 ms 0 KB
int N,M;char A[500][500],B[500][500];
main(){scanf("%d%d",&N,&M);
       for(int i=0;i<N;i++)scanf("%s",A);
       for(int i=0;i<N;i++)scanf("%s",B);
       for(int i=0;i<N;i++)for(int j=0;j<M+M;j++) if(B[i][j]!=A[i][j/2]) return 0 & puts("Not Efya");
         puts("Efya");
      }

Compilation message

ee.c:2:1: warning: return type defaults to ‘int’ [-Wreturn-type]
 main(){scanf("%d%d",&N,&M);
 ^
ee.c: In function ‘main’:
ee.c:2:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
ee.c:2:8: warning: incompatible implicit declaration of built-in function ‘scanf’
 main(){scanf("%d%d",&N,&M);
        ^
ee.c:3:8: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
        for(int i=0;i<N;i++)scanf("%s",A);
        ^
ee.c:3:8: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
ee.c:3:8: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[500]’ [-Wformat=]
ee.c:4:16: error: redefinition of ‘i’
        for(int i=0;i<N;i++)scanf("%s",B);
                ^
ee.c:3:16: note: previous definition of ‘i’ was here
        for(int i=0;i<N;i++)scanf("%s",A);
                ^
ee.c:4:8: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
        for(int i=0;i<N;i++)scanf("%s",B);
        ^
ee.c:4:8: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[500]’ [-Wformat=]
ee.c:5:16: error: redefinition of ‘i’
        for(int i=0;i<N;i++)for(int j=0;j<M+M;j++) if(B[i][j]!=A[i][j/2]) return 0 & puts("Not Efya");
                ^
ee.c:4:16: note: previous definition of ‘i’ was here
        for(int i=0;i<N;i++)scanf("%s",B);
                ^
ee.c:5:8: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
        for(int i=0;i<N;i++)for(int j=0;j<M+M;j++) if(B[i][j]!=A[i][j/2]) return 0 & puts("Not Efya");
        ^
ee.c:5:28: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
        for(int i=0;i<N;i++)for(int j=0;j<M+M;j++) if(B[i][j]!=A[i][j/2]) return 0 & puts("Not Efya");
                            ^
ee.c:5:8: warning: implicit declaration of function ‘puts’ [-Wimplicit-function-declaration]
        for(int i=0;i<N;i++)for(int j=0;j<M+M;j++) if(B[i][j]!=A[i][j/2]) return 0 & puts("Not Efya");
        ^
ee.c:7:7: warning: control reaches end of non-void function [-Wreturn-type]
       }
       ^