112A - Petya and Strings
来源:互联网 发布:淘宝超级店长软件 编辑:程序博客网 时间:2024/05/29 17:06
#include <cmath>#include <cstdio>#include <cstdlib>#include <cstring>#include <iostream>#include <string>#include <algorithm>using namespace std;int main() { string a, b; cin >> a >> b; int l1 = a.length(); int l2 = b.length(); int i = 0, j = 0; int flag = 0; while(i < l1 || j < l2) { int x1, x2; if(a[i] >= 'A' && a[i] <= 'Z') x1 = a[i] - 'A'; if(a[i] >= 'a' && a[i] <= 'z') x1 = a[i] - 'a'; if(b[j] >= 'A' && b[j] <= 'Z') x2 = b[j] - 'A'; if(b[j] >= 'a' && b[j] <= 'z') x2 = b[j] - 'a'; if(x1 > x2 || j == l2) { flag = 1; break; } if(x1 < x2 || i == l1) { flag = -1; break; } ++i, ++j; } cout << flag << endl; return 0;}
0 0
- 112A - Petya and Strings
- 112A - Petya and Strings
- A. Petya and Strings
- CF:112A.Petya and Strings
- CF 112A Petya and Strings
- codeforces 112A Petya and Strings
- 【CodeForces】A. Petya and Strings
- Problem--112A--Codeforces--A. Petya and Strings
- Codeforces 112A-Petya and Strings(实现)
- CodeForces 112 A.Petya and Strings(水~)
- 【string比较】#85 A. Petya and Strings
- Petya and Strings
- Coderforces Petya and Strings
- Codeforces刷题之路——112A Petya and Strings
- A. Petya and Java
- 【水String】#61 A. Petya and Java
- A. Vasya and Petya's Game
- 【CodeForces】[66A]Petya and Java
- CTCI---8.1.1
- 《Unity网络多玩家游戏开发教程(上册)》
- cp命令如何排除不想拷贝的子目录
- sysbench 基准测试简介
- hdoj2544_最短路(最短路径)
- 112A - Petya and Strings
- js闭包的理解
- hdu1492 The number of divisors(约数) about Humble Numbers(公约数个数问题)
- 信息安全试验课遇到的一个问题
- 个号几个环节各环节
- imx6 uboot logo
- iOS开发笔记
- 连载一 新的开始
- oracle 常用查询总结