# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
2654 | domece | 최댓값 (tutorial2) | C11 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#include <assert.h>
#include <malloc.h>
int GetMax(int N, int *A);
int main(){
int i, tmp;
int N;
tmp = scanf("%d", &N);
assert(tmp == 1);
int *A = (int*) malloc( sizeof(int) * N );
for(i = 0; i < N; i++){
tmp = scanf("%d", &A[i]);
assert(tmp == 1);
}
printf("%d\n", GetMax(N, A));
return 0;
}
int GetMax(int N,int *A){
int i,TmpMax=-1;
for(i=0;i<N;i++){
if(TmpMax<A[i]) TmpMax=A[i];
}
return TmpMax;
}