Topic 1170: Finding the most decimal places
time limit:1 seconds
Memory limit:32 MB
Special question: No
submitted:5464
Resolution:2415
-
Title Description:
-
The first line inputs a number n,1 <= n <= 1000, the following input n rows of data, each row has two numbers, respectively X Y. Outputs a set of X Y, which is the smallest of the x in all data, and the smallest of y in cases where x is equal.
-
Input:
-
Enter more than one set of data.
Enter n for each group, and then enter n integer pairs.
-
Output:
-
Outputs the smallest integer pair.
-
Sample input:
-
5 3 3 2 2 5 5 2 1 3 6
-
Sample output:
-
2 1
-
Source:
2010 The computer research of the posts of posts and telecommunications
#include <stdio.h> #include <stdlib.h>int main () { int x,y,minx,miny; int i,n; while (scanf ("%d", &n)!=eof) { scanf ("%d%d", &minx,&miny); for (i=1;i<n;i++) { scanf ("%d%d", &x,&y); if (X<minx) { minx=x; miny=y; } else if (x==minx&&y<miny) { miny=y; } } printf ("%d%d\n", minx,miny); } return 0;}
Nine degrees OJ 1170 find the decimal