답안 #7051

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
7051 2014-07-20T10:28:07 Z koosaga 쉬운 문제 (GA3_easy) C++
컴파일 오류
0 ms 0 KB
#include <stdio.h>

int main(){
    int n,i,j=1,r=0;
    scanf("%d",&n);
    int a[n];
    for (i=0; i<n; i++) {
        scanf("%d",&a[i]);
    }
    for (i=0; i<n-1; i++) {
        for (j=i+1; j<n; j++) {
            if(a[j]%a[i]==0) r++;
        }
    }
    printf("%d",r);
}

Compilation message

easy.cpp: In function 'int main()':
easy.cpp:5:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
easy.cpp:8:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
/tmp/ccgOWlXm.o: In function `main':
easy.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccZTXuAR.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/ccZTXuAR.o: In function `main':
grader.cpp:(.text.startup+0x97): undefined reference to `CountPair(int, int*)'
collect2: ld returned 1 exit status