码迷,mamicode.com
首页 > 其他好文 > 详细

Codeforces 112A

时间:2019-11-06 10:27:19      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:using   ring   ORC   code   iostream   namespace   out   size   codeforce   

#include <iostream>
#include <string>
#include <cctype>
using namespace std;

int main()
{
	string str1;
	string str2;
	int length;
	while(cin>>str1>>str2)
	{
		length=str1.size();
		int i;
		for(i=0; i<length; ++i)
		{
			str1[i]=tolower(str1[i]);
			str2[i]=tolower(str2[i]);
			if((str1[i]-‘0‘)>(str2[i]-‘0‘))
			{
				cout<<1<<endl;
				break;
			}
			else if((str1[i]-‘0‘) < (str2[i]-‘0‘))
			{
				cout<<-1<<endl;
				break;
			}
		}
		if(i==length)
			cout<<0<<endl;
	}
	return 0;
}

  

Codeforces 112A

标签:using   ring   ORC   code   iostream   namespace   out   size   codeforce   

原文地址:https://www.cnblogs.com/commario/p/11803494.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!