제출 #14371

#제출 시각아이디문제언어결과실행 시간메모리
14371ggoh쉬운 문제 (GA3_easy)C++98
컴파일 에러
0 ms0 KiB
#include<cstdio> main(){int a[100],b,i,j,x=0;scanf("%d",&b);for(i=0;i<b;i++)scanf("%d",&a[i]); for(i=0;i<b-1;i++){for(j=i+1;j<b;j++)if(a[j]%a[i]==0)x++;} printf("%d",x);}

컴파일 시 표준 에러 (stderr) 메시지

easy.cpp:2:6: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
 main(){int a[100],b,i,j,x=0;scanf("%d",&b);for(i=0;i<b;i++)scanf("%d",&a[i]);
      ^
easy.cpp: In function ‘int main()’:
easy.cpp:2:43: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
 main(){int a[100],b,i,j,x=0;scanf("%d",&b);for(i=0;i<b;i++)scanf("%d",&a[i]);
                                           ^
easy.cpp:2:77: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
 main(){int a[100],b,i,j,x=0;scanf("%d",&b);for(i=0;i<b;i++)scanf("%d",&a[i]);
                                                                             ^
/tmp/cc8iYI3t.o: In function `main':
easy.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccxgpgVI.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/ccxgpgVI.o: In function `main':
grader.cpp:(.text.startup+0x97): undefined reference to `CountPair(int, int*)'
collect2: error: ld returned 1 exit status