답안 #14373

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14373 2015-05-13T03:09:39 Z ggoh 쉬운 문제 (GA3_easy) C++
컴파일 오류
0 ms 0 KB
#include<cstdio>
int a[100],b,i,j,x;main(){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);}

Compilation message

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