zoukankan      html  css  js  c++  java
  • UVA 11172 discussRelational Operator

    Some operators checks about the relationship between two values and these operators are called relational operators. Given two numerical values your job is just to find out the relationship between them that is (i) First one is greater than the second (ii) First one is less than the second or (iii) First and second one is equal.

    Input

    First line of the input file is an integer t (t<15) which denotes how many sets of inputs are there. Each of the next t lines contain two integers a and b (|a|,|b|<1000000001). 

    Output

    For each line of input produce one line of output. This line contains any one of the relational operators “>”, “<” or “=”, which indicates the relation that is appropriate for the given two numbers.

    Sample Input                          Output for Sample Input

    3
    10 20
    20 10
    10 10

    =

    题意:第一行输入一个正整数t(t<12),表示测试数据的组数,判断这两个数的关系:i:>,ii:<,iii:=。

    分析:用开关语句或者多重if语句。

    AC源代码(C语言):

     1 #include<stdio.h>
     2 int main()
     3 {
     4           int t;
     5           long int a,b;
     6           scanf("%d",&t);
     7           while(t--)
     8               {
     9                   scanf("%ld%ld",&a,&b);
    10                   if(a>b)  printf(">\n");
    11                   else if(a<b)  printf("<\n");
    12                   else printf("=\n");                         
    13               }
    14           return 0;        
    15 }

    2013-03-16

  • 相关阅读:
    二分法检索数组
    Linux安装CDH
    myeclipse操作hdfs
    Linux安装hbase
    Linux安装zookeeper
    Linux安装msql
    fluem全分布环境搭建
    bash: jps: 未找到命令...
    自动化项目Jenkins持续集成
    linux卸载mysql====安装新的虚拟机 自带的基本都要卸载!? mysql tomcat java Python可以不用卸载
  • 原文地址:https://www.cnblogs.com/fjutacm/p/2932727.html
Copyright © 2011-2022 走看看