Блог пользователя a5306807

Автор a5306807, 12 лет назад, По-английски

It is a piece of cake for a master-hand...but I just a new here, even a new in programming. Link:http://mirror.codeforces.com/problemset/problem/112/A

I got an AC only try it once,it seems that I find the right way at first. When I'm face with the 149.A got the WA a whole night...= = The code?I don't know how to put it here...I will try it.... ~~~~~ 1200663 ~~~~~

#include <iostream>
#include <string>
#include <cstdio>

#include <cstring>
using namespace std;
char a1[110];
char a2[110];
char b1[110];
char b2[110];


int Cmp(char *pstr1,char *pstr2)
  {int i,t;
  for(i=0;pstr1[i]!='\0';i++)
  if(pstr1[i]>='A'&&pstr1[i]<='Z')
  *(pstr1+i)=*(pstr1+i)+32;
  for(i=0;pstr2[i]!='\0';i++)
  if(pstr2[i]>='A'&&pstr2[i]<='Z')
  *(pstr2+i)=*(pstr2+i)+32;
  t=0;
  for(i=0;i<strlen(pstr1);i++)
      {if(*(pstr1+i)>*(pstr2+i))
              {t=1;break;}
        if(*(pstr1+i)<*(pstr2+i))
              {t=-1;break;}
      if(*(pstr1+i)>*(pstr2+i))
      continue;      
      
      }
        return t;  
  }
             
             
             
int main()
  {int t;
  gets(a1);
  gets(a2);
  t=Cmp(a1,a2);
  
  if(t==1) cout<<1;
  if(t==-1)cout<<-1;
  if(t==0)cout<<0;     
      cin.get();    
          cout<<endl;
          
return 0;          
}
  • Проголосовать: нравится
  • -20
  • Проголосовать: не нравится

»
12 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится
  • »
    »
    12 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Seems like links with Chinese anchor text do not work. That one was to Google Translate.

    • »
      »
      »
      12 лет назад, # ^ |
        Проголосовать: нравится +3 Проголосовать: не нравится

      Why do I have to type my words in English?

      • »
        »
        »
        »
        12 лет назад, # ^ |
          Проголосовать: нравится +3 Проголосовать: не нравится

        The translation on Google is a word-by-word translation, so I considerate that even you can do it successfully you won't be able to understand the translation..

»
12 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

原来可以输中文