3
A. Petya and Strings
source link: https://codeforces.com/blog/entry/110899
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
c++ ~~~~~ Your code here...#include
include
using namespace std;
int main() { string a, b; cin >> a >> b;
int cnt1 = 0, cnt2 = 0;
for (int i = 0; i < a.size(); i ++ )
{
if (a[i] >= 'A' && a[i] <= 'Z')
a[i] = a[i] - 'A' + 'a';
if (b[i] >= 'A' && b[i] <= 'Z')
b[i] = b[i] - 'A' + 'a';
if (a[i] > b[i])
{
cout << "1" << endl;
exit(0);
}
if (a[i] == b[i]) continue;
if (a[i] < b[i])
{
cout << "-1" << endl;
exit(0);
}
}
cout << "0" << endl;
return 0;
~~~~~
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK