답안 #148349

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
148349 2019-09-01T03:50:00 Z sg1774 최댓값 (tutorial2) C++11
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
int a[200];
int main(){
    int z,s=0;
    scanf("%d",&z);
    for(int i=0;i<z;i++){
        scanf("%d",&a[i]);
        s=max(s,a[i]);
    }
    printf("%d",s);
	return 0;
}

Compilation message

tutorial2.cpp: In function 'int main()':
tutorial2.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&z);
     ~~~~~^~~~~~~~~
tutorial2.cpp:8:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&a[i]);
         ~~~~~^~~~~~~~~~~~
/tmp/ccL9ne5u.o: In function `main':
tutorial2.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccRL88U5.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/ccRL88U5.o: In function `main':
grader.cpp:(.text.startup+0x97): undefined reference to `GetMax(int, int*)'
collect2: error: ld returned 1 exit status