답안 #16262

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
16262 2015-08-19T04:37:30 Z eaststar 쉬운 문제 (GA3_easy) C++14
컴파일 오류
0 ms 0 KB
#include <stdio.h>
int a[60],cnt;
int main(){
	int i,j,n;
	scanf("%d",&n);
	for(i=1;i<=n;++i)scanf("%d",&a[i]);
	for(i=1;i<=n;++i){
		for(j=i+1;j<=n;++j)if(i!=j&&a[j]%a[i]==0)++cnt;
	}
	printf("%d",cnt);
	return 0;
}

Compilation message

easy.cpp: In function ‘int main()’:
easy.cpp:5:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
                ^
easy.cpp:6:36: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  for(i=1;i<=n;++i)scanf("%d",&a[i]);
                                    ^
/tmp/ccqXll4E.o: In function `main':
easy.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccWelbOs.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/ccWelbOs.o: In function `main':
grader.cpp:(.text.startup+0x97): undefined reference to `CountPair(int, int*)'
collect2: error: ld returned 1 exit status