Problem description

Little Petya loves presents. His mum bought him two strings of the same size for his birthday. The strings consist of uppercase and lowercase Latin letters. Now Petya wants to compare those two strings lexicographically. The letters' case does not matter, that is an uppercase letter is considered equivalent to the corresponding lowercase letter. Help Petya perform the comparison.

Input

Each of the first two lines contains a bought string. The strings' lengths range from 1 to 100 inclusive. It is guaranteed that the strings are of the same length and also consist of uppercase and lowercase Latin letters.

Output

If the first string is less than the second one, print "-1". If the second string is less than the first one, print "1". If the strings are equal, print "0". Note that the letters' case is not taken into consideration when the strings are compared.

Examples

Input

aaaa
aaaA

Output

0

Input

abs
Abz

Output

-1

Input

abcdefg
AbCdEfF

Output

1

Note

If you want more formal information about the lexicographical order (also known as the "dictionary order" or "alphabetical order"), you can visit the following site:http://en.wikipedia.org/wiki/Lexicographical_order.

解题思路:先把两个字符串中的大写字母全部换成小写字母,然后用strcmp(s1,s2)函数比较两个字符串的大小,水过。

AC代码:

 #include<bits/stdc++.h>
using namespace std;
int main(){
char s1[],s2[];
cin>>s1>>s2;
for(int i=;s1[i]!='\0';++i){
if(s1[i]>='A'&&s1[i]<='Z')s1[i]+=;
if(s2[i]>='A'&&s2[i]<='Z')s2[i]+=;
}
if(strcmp(s1,s2)>)cout<<""<<endl;
else if(strcmp(s1,s2)<)cout<<"-1"<<endl;
else cout<<""<<endl;
return ;
}

A - Petya and Strings的更多相关文章

  1. codeforces水题100道 第二十四题 Codeforces Beta Round #85 (Div. 2 Only) A. Petya and Strings (strings)

    题目链接:http://www.codeforces.com/problemset/problem/112/A题意:忽略大小写,比较两个字符串字典序大小.C++代码: #include <cst ...

  2. codeforces 112APetya and Strings(字符串水题)

    A. Petya and Strings 点击打开题目 time limit per test 2 seconds memory limit per test 256 megabytes input ...

  3. Codeforces 112A-Petya and Strings(实现)

    A. Petya and Strings time limit per test 2 seconds memory limit per test 256 megabytes input standar ...

  4. Codeforces 149 E. Martian Strings

    正反两遍扩展KMP,维护公共长度为L时.出如今最左边和最右边的位置. . .. 然后枚举推断... E. Martian Strings time limit per test 2 seconds m ...

  5. CodeForces832-B. Petya and Exam

    补的若干年以前的题目,水题,太菜啦_(:з」∠)_    B. Petya and Exam time limit per test 2 seconds memory limit per test 2 ...

  6. Codeforces Round #425 (Div. 2) Problem B Petya and Exam (Codeforces 832B) - 暴力

    It's hard times now. Today Petya needs to score 100 points on Informatics exam. The tasks seem easy ...

  7. Codeforces Round #425 (Div. 2) B. Petya and Exam(字符串模拟 水)

    题目链接:http://codeforces.com/contest/832/problem/B B. Petya and Exam time limit per test 2 seconds mem ...

  8. CodeForces 832B Petya and Exam

    B. Petya and Exam time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...

  9. Codeforces Round #425 (Div. 2) B - Petya and Exam

    地址:http://codeforces.com/contest/832/problem/B 题目: B. Petya and Exam time limit per test 2 seconds m ...

随机推荐

  1. 五、Scrapy中Item Pipeline的用法

    本文转载自以下链接: https://scrapy-chs.readthedocs.io/zh_CN/latest/topics/item-pipeline.html https://doc.scra ...

  2. Centos 7 关闭firewall防火墙启用iptables防火墙

    一.关闭firewall防火墙 1.停止firewall systemctl stop firewalld.service 2.禁止firewall开机启动 systemctl disable fir ...

  3. CTF实战(隐写术):欢迎来到地狱

    前言:请登录实验吧开启刷题模式,拿到的flag返回该网站验证正确性. 下载“欢迎来到地狱”CTF题目(总共三个文件

  4. Pyhon信息采集 - 喜马拉雅专辑歌曲

    目录 Pyhon信息采集 - 喜马拉雅专辑歌曲 Pyhon信息采集 - 喜马拉雅专辑歌曲 setting.py # 喜马拉雅URL XMLY_URL = "https://www.ximal ...

  5. Django——9 博客小案例的实现

    Django  博客小案例的实现 主要实现博客的增删改查功能 主页index.html  -->  展示添加博客和博客列表的文字,实现页面跳转 添加页add.html  --> 输入文章标 ...

  6. mongodb系列之-治理mongodb->db.currentOp()

    mongodb系列之-管理mongodb->db.currentOp() 管理mongodb->db.currentOp(), 绝对是原创... 今天公司的dba在内部分享了针对mysql ...

  7. 清北学堂模拟赛d3t2 b

    分析:一道比较让人头疼的数学题. 先考虑怎么让分出来的三角形相似,先不考虑每个三角形的具体边长,设每个三角形的周长为li,则可知必然有一个数g = gcd{li},每一个三角形的周长都是g的倍数,这样 ...

  8. Sencha Toucha 2.1 文件上传

    javascript代码: Ext.onReady(function() { Ext.create('Ext.form.Panel', { title: 'Upload a Photo', width ...

  9. HBase(0.96)新的Java API操作

    package test; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.ap ...

  10. nyoj_448_寻求最大数_201402261424

    寻找最大数 时间限制:1000 ms  |           内存限制:65535 KB 难度:2   描述 请在整数 n 中删除m个数字, 使得余下的数字按原次序组成的新数最大, 比如当n=920 ...