Problem--112A--Codeforces--A. Petya and Strings
来源:互联网 发布:cms监控系统 编辑:程序博客网 时间:2024/06/06 00:24
A. Petya and Strings
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard outputLittle 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
1Note
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
#include<stdio.h>#include<string.h>int main(){ char str1[105],str2[105]; scanf("%s%s",str1,str2); printf("%d\n",strcasecmp(str1,str2));}
- Problem--112A--Codeforces--A. Petya and Strings
- codeforces 112A Petya and Strings
- 【CodeForces】A. Petya and Strings
- 112A - Petya and Strings
- 112A - Petya and Strings
- A. Petya and Strings
- Codeforces 112A-Petya and Strings(实现)
- CodeForces 112 A.Petya and Strings(水~)
- CF:112A.Petya and Strings
- CF 112A Petya and Strings
- Codeforces刷题之路——112A Petya and Strings
- 【string比较】#85 A. Petya and Strings
- 【CodeForces】[66A]Petya and Java
- Codeforces 66A Petya and Java
- CodeForces 66A - Petya and Java(思维)
- A. Petya and Java
- CodeForces 576A - Vasya and Petya's Game
- Codeforces 66A:Petya and Java(水题)
- 监控点排序核心算法
- 我在使用 NPOI 时遇到的问题
- Oracle中的Merge函数
- NTC33 iPHONE 7 Red Lucky Draw in iBET(ibet Lucky Draw, iPhone 7 Red, Lucky Draw Promotion)
- ImageView加载图片资源并进行缩放
- Problem--112A--Codeforces--A. Petya and Strings
- 我在使用 NPOI 时遇到的问题
- bzoj1013[JSOI2008]球形空间产生器sphere
- Java连接数据库实例
- Mysql中的MVCC
- C# .Net 成员可访问性修饰符
- 解决struts2接收不到页面传递过来的对象VO的问题
- 让你 Oracle 的存储过程与Java代码开始进行交互
- 面向对象三大基本特征和五大原则