Problem Type : Super Easy
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
long int n,m,i,j,a[1000];
while(scanf("%ld",&m)==1)
{
for(j=1; j<=m; j++)
{
scanf("%ld",&n);
for(i=0; i<n; i++)
{
scanf("%d",&a[i]);
}
sort(a,(a+n));
printf("Case %d: %ld\n",j,a[n-1]);
}
}
return 0;
}
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
long int n,m,i,j,a[1000];
while(scanf("%ld",&m)==1)
{
for(j=1; j<=m; j++)
{
scanf("%ld",&n);
for(i=0; i<n; i++)
{
scanf("%d",&a[i]);
}
sort(a,(a+n));
printf("Case %d: %ld\n",j,a[n-1]);
}
}
return 0;
}
No comments:
Post a Comment