제출 #7051

#제출 시각아이디문제언어결과실행 시간메모리
7051koosaga쉬운 문제 (GA3_easy)C++98
컴파일 에러
0 ms0 KiB
#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);
}

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

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