zoukankan      html  css  js  c++  java
  • A == B ?

    A == B ?

    Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
    Total Submission(s): 145 Accepted Submission(s): 65
     
    Problem Description
    Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".
     
    Input
    each test case contains two numbers A and B.
     
    Output
    for each case, if A is equal to B, you should print "YES", or print "NO".
     
    Sample Input
    1 2
    2 2
    3 3
    4 3
     
    Sample Output
    NO
    YES
    YES
    NO
     
    Author
    8600 && xhd
     
    Source
    校庆杯Warm Up
     
    Recommend
    linle
    import java.math.BigDecimal;
    import java.util.Scanner;
    
    public class Main {
        /*
        题意:略
    
        初步思路:我靠!这么水的题,怎么可能这么水,用string爆
    
        #错误:竟然wa了...字符数组试试
    
        #错误:用字符数组也是不行的,正负情况,麻烦直接用java
        */
        public static void main(String[] args) {
        // write your code here
            Scanner cin=new Scanner(System.in);
            BigDecimal a,b;
            while(cin.hasNext()){
                a=cin.nextBigDecimal();
                b=cin.nextBigDecimal();
                System.out.println(a.compareTo(b)==0?"YES":"NO");
            }
        }
    }
  • 相关阅读:
    Python循环语句
    Python判断语句
    MySQL的基本操作汇总
    Python函数、类
    Python字典、集合
    Python列表、元组
    python数据类型--数字、字符串
    Python基础认识
    搭建Python独立虚拟环境
    Python包管理工具
  • 原文地址:https://www.cnblogs.com/wuwangchuxin0924/p/6388552.html
Copyright © 2011-2022 走看看