Submission #16263

# Submission time Handle Problem Language Result Execution time Memory
16263 2015-08-19T04:38:28 Z eaststar 쉬운 문제 (GA3_easy) C++14
Compilation error
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:34: 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/ccDbnvHM.o: In function `main':
easy.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc4w8DzD.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/cc4w8DzD.o: In function `main':
grader.cpp:(.text.startup+0x97): undefined reference to `CountPair(int, int*)'
collect2: error: ld returned 1 exit status