Codeforces Beta Round #85 (Div. 2 Only), problem: (A) Petya and Strings solution: http://ideone.com/DIWRcB
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main() { char a[105], b[105]; scanf("%s%s", a, b); for(int i=0; i<strlen(a); i++) { if(a[i]>96) a[i]-=32; if(b[i]>96) b[i]-=32; } printf("%d", strcmp(a, b)); return 0; }
No comments:
Post a Comment