zoukankan      html  css  js  c++  java
  • CodeForces 616A(水题)

    while(t--)

    最后结果t=-1

    #include <iostream>
    #include <string>
    #include <cstring>
    #include <cstdlib>
    #include <cstdio>
    #include <cmath>
    #include <algorithm>
    #include <stack>
    using namespace std;
    
    #define MEM(a,b) memset(a,b,sizeof(a))
    #define pf printf
    #define sf scanf
    #define debug printf("!/n")
    #define INF 1000
    #define MAX(a,b) a>b?a:b
    #define blank pf("
    ")
    #define LL long long
    
    char a[10],b[10];
    
    int main()
    {
              int i,j;
              while(~sf("%s",a))
              {
                   sf("%s",b);
                   int m=0,n=0;
                   while(a[m]=='0') m++;
                   while(b[n]=='0') n++;
                   int len1 = strlen(a)-m;
                   int len2 = strlen(b)-n;
                   if(len1>len2)
                        pf(">
    ");
                   else if(len2>len1)
                        pf("<
    ");
                   else
                   {
                             while(len1--)
                             {
                                       if(a[m]>b[n])
                                       {
                                            pf(">
    ");
                                            break;
                                       }
                                       else if(a[m]<b[n])
                                       {
                                            pf("<
    ");
                                            break;
                                       }
                                       else
                                       {
                                            m++;
                                            n++;
                                       }
                              }
                              if(len1==-1)
                                  pf("=
    ");
    
                   }
              }
              return 0;
    }
  • 相关阅读:
    php设计模式-适配器
    遍历Map的4种方法
    遍历数组
    遍历List的方法
    复选框选中
    单选框选中
    正向代理和反向代理
    对于Dubbo的理解
    python远程控制Linux
    python对中文的处理
  • 原文地址:https://www.cnblogs.com/qlky/p/5154460.html
Copyright © 2011-2022 走看看