zoukankan      html  css  js  c++  java
  • HDU_2054——A=B问题

    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
     1 #include <cstdio>
     2 #include <cstring>
     3 char* fun(char *str)
     4 {
     5     if(strchr(str,'.')!=NULL)
     6         {
     7             int i=strlen(str);
     8             while(str[--i]=='0');
     9             if(str[i]=='.')
    10                 i--;
    11             str[i+1]='';
    12         }
    13     return str;
    14 }
    15 //不用考虑前导0的情况 
    16 int main()
    17 {
    18     char a[100000],b[100000];
    19     while(~scanf("%s%s",a,b))
    20         {
    21             if(strcmp(fun(a),fun(b))==0)
    22                 printf("YES
    ");
    23             else
    24                 printf("NO
    ");
    25         }
    26     return 0;    
    27 }
    ——现在的努力是为了小时候吹过的牛B!!
  • 相关阅读:
    EditText之边框颜色
    Android之drawable state各个属性详解
    Android-第三天
    Android 问题
    ios VS android
    Android-第二天(2)
    collapse
    2020/3/7
    2020/3/6
    P3825 [NOI2017]游戏
  • 原文地址:https://www.cnblogs.com/pingge/p/3185133.html
Copyright © 2011-2022 走看看