Nine degrees OJ 1170 find the decimal

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.