codeforces水题100道 第二十四题 Codeforces Beta Round #85 (Div. 2 Only) A. Petya and Strings (strings)
题目链接:http://www.codeforces.com/problemset/problem/112/A
题意:忽略大小写,比较两个字符串字典序大小。
C++代码:
#include <cstdio>
#include <cstring>
int cmp(char *s, char *t)
{
while (*s)
{
if (*s <= 'Z') *s += ;
if (*t <= 'Z') *t += ;
if (*s < *t) return -;
else if (*s > *t) return ;
s ++;
t ++;
}
return ;
}
int main()
{
char *s = new char[];
char *t = new char[];
scanf("%s%s", s, t);
printf("%d\n", cmp(s, t));
}
C++
codeforces水题100道 第二十四题 Codeforces Beta Round #85 (Div. 2 Only) A. Petya and Strings (strings)的更多相关文章
- codeforces水题100道 第二十六题 Codeforces Beta Round #95 (Div. 2) A. cAPS lOCK (strings)
题目链接:http://www.codeforces.com/problemset/problem/131/A题意:字符串大小写转换.C++代码: #include <cstdio> #i ...
- codeforces水题100道 第二十五题 Codeforces Round #197 A. Helpful Maths (Div. 2) (strings)
题目链接:http://www.codeforces.com/problemset/problem/339/A题意:重新组合加法字符串,使得按照1,2,3的顺序进行排列.C++代码: #include ...
- codeforces水题100道 第二十二题 Codeforces Beta Round #89 (Div. 2) A. String Task (strings)
题目链接:http://www.codeforces.com/problemset/problem/118/A题意:字符串转换……C++代码: #include <string> #inc ...
- codeforces水题100道 第十四题 Codeforces Round #321 (Div. 2) A. Kefa and First Steps (brute force)
题目链接:http://www.codeforces.com/problemset/problem/580/A题意:求最长连续非降子序列的长度.C++代码: #include <iostream ...
- codeforces水题100道 第二十题 Codeforces Round #191 (Div. 2) A. Flipping Game (brute force)
题目链接:http://www.codeforces.com/problemset/problem/327/A题意:你现在有n张牌,这些派一面是0,另一面是1.编号从1到n,你需要翻转[i,j]区间的 ...
- codeforces水题100道 第十九题 Codeforces Round #109 (Div. 2) A. I_love_%username% (brute force)
题目链接:http://www.codeforces.com/problemset/problem/155/A题意:找到当前最大值或者最小值出现的次数.“当前”的意思差不多是a[i]大于所有a[j]( ...
- codeforces水题100道 第十八题 Codeforces Round #289 (Div. 2, ACM ICPC Rules) A. Maximum in Table (brute force)
题目链接:http://www.codeforces.com/problemset/problem/509/A题意:f[i][1]=f[1][i]=1,f[i][j]=f[i-1][j]+f[i][j ...
- codeforces水题100道 第十六题 Codeforces Round #164 (Div. 2) A. Games (brute force)
题目链接:http://www.codeforces.com/problemset/problem/268/A题意:足球比赛中如果主场球队的主场球衣和客队的客队球衣颜色一样,那么要求主队穿上他们的可对 ...
- codeforces水题100道 第十五题 Codeforces Round #262 (Div. 2) A. Vasya and Socks (brute force)
题目链接:http://www.codeforces.com/problemset/problem/460/A题意:Vasya每天用掉一双袜子,她妈妈每m天给他送一双袜子,Vasya一开始有n双袜子, ...
随机推荐
- python gpio
打算用python控制gpio,网上找的都是一些关于树莓派如何操作gpio的文档,只针对树莓派.所以就自己封装一下函数,方便以后使用.在linux上已经生成了和gpio相关的文件,只要对文件进行读取即 ...
- Eclipse创建一个Maven Web项目
在这篇文章中,我们将演示如何在Eclipse IDE中使用maven创建一个动态Web项目. 使用的工具和技术 - Eclipse Jee Oxygen Maven 3.3.3 JavaSE 1.8 ...
- Maven项目文档
本教程学习如何一步到位地创建应用程序的文档.因此现在开始我们进入到 C:\MVN 创建 java 应用程序项目:consumerBanking. 进入到项目文件夹中执行以下命令 mvn 命令. C: ...
- QA:无法为具有固定名称“MySql.Data.MySqlClient”...
Question: 无法为具有固定名称“MySql.Data.MySqlClient”的 ADO.NET 提供程序加载在应用程序配置文件中注册的实体框架提供程序类型“MySql.Data.MySqlC ...
- WebSphere异常:Servlet has become temporarily unavailable for service
今天发现WebSphere中的一个应用图片看不见了,单独在浏览器中访问图片的路径http://ip地址:9080/应用/--/images/top.jpg,也不显示图片,并且提示异常Servlet h ...
- CentOS 7系统查看系统版本和机器位数
前言 由于不经常使用linux,每当使用的时候就是安装软件,安装软件的时候就要选择安装包平台,是32位的还是64位的.这时候突然发现不知道怎么查,于是百度.虽然轻而易举百度出来,但仍旧没有自己的笔记看 ...
- Linux系统教程:设置GRUB菜单密码
1.认识启动配置选项 [root@server5 ~]# cat /boot/grub/grub.conf # grub.conf generated by anaconda # # Note ...
- window wlan 相关服务
1.Extensible authentication protocol 2.cng key lsolation 3.wlan autoconfig
- Intellij 2016非服务器激活
下载 http://idea.lanyus.com/jar/JetbrainsCrack-2.6.2.jar 并将 JetbrainsCrack-2.6.0.jar 放置到 D盘根目录(也可以根据自己 ...
- Nginx配置优化解读
全局配置 Nginx的配置文件是nginx的安装目录的conf/nginx .conf,nginx.conf配置文件中,几个全局高级配置在模块部分之上. user www www; worker_p ...