[HDU] [2071] Max Num

Problem Description

Loading...

Problem Analysis

Protect your brainpower
Start with me~
Oh yeah

When will I ever get through the legendary 11 pages…

cpp
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include<stdio.h>
int main() {
	int T;
	scanf("%d",&T);
	while(T--) {
		int n;
		double max,t;
		scanf("%d",&n);
		for(int i=0; i<n; i++) {
			scanf("%lf",&t);
			if(i==0||t>max)
				max=t;
		}
		printf("%.2lf\n",max);
	}
	return 0;
}

Problem link: HDU 2071 Max Num

This post is licensed under CC BY-NC-SA 4.0. If it helped, or if you have anything to say, the comment box below is open.
Page views —
Unique visitors —

Loading...