#include<stdio.h> #include<algorithm>using namespace std;int main(){int i,j,a[j];while(scanf("%d\n",&j)!=EOF){ for(i=0;i<j;i++)scanf("%d",&a[i]);sort(a,a+j);printf("%d",a[j-1]);printf("\n"); } }
自己測試都行
但還是一直NA
#include #includeusing namespace std;int main(){int i,j,a[j];while(scanf("%d\n",&j)!=EOF){ for(i=0;iscanf("%d",&a[i]);sort(a,a+j);printf("%d",a[j-1]);printf("\n"); } }