Submission #250127

#TimeUsernameProblemLanguageResultExecution timeMemory
250127linear00000최댓값 (tutorial2)C++14
Compilation error
0 ms0 KiB
#include<iostream> int GetMax(int n, int A[]) { cin >> n; for (int i=0; i<n; i++) cin >> A[i]; int a = -1; for (int i=0; i<n; i++) if (a > A[i]) a = A[i]; return a; }

Compilation message (stderr)

tutorial2.cpp: In function 'int GetMax(int, int*)':
tutorial2.cpp:4:3: error: 'cin' was not declared in this scope
   cin >> n;
   ^~~
tutorial2.cpp:4:3: note: suggested alternative:
In file included from tutorial2.cpp:1:0:
/usr/include/c++/7/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^~~