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

  1. #include <cstdio>
  2. #include <cstring>
  3. int cmp(char *s, char *t)
  4. {
  5. while (*s)
  6. {
  7. if (*s <= 'Z') *s += ;
  8. if (*t <= 'Z') *t += ;
  9. if (*s < *t) return -;
  10. else if (*s > *t) return ;
  11. s ++;
  12. t ++;
  13. }
  14. return ;
  15. }
  16. int main()
  17. {
  18. char *s = new char[];
  19. char *t = new char[];
  20. scanf("%s%s", s, t);
  21. printf("%d\n", cmp(s, t));
  22. }

C++

codeforces水题100道 第二十四题 Codeforces Beta Round #85 (Div. 2 Only) A. Petya and Strings (strings)的更多相关文章

  1. codeforces水题100道 第二十六题 Codeforces Beta Round #95 (Div. 2) A. cAPS lOCK (strings)

    题目链接:http://www.codeforces.com/problemset/problem/131/A题意:字符串大小写转换.C++代码: #include <cstdio> #i ...

  2. codeforces水题100道 第二十五题 Codeforces Round #197 A. Helpful Maths (Div. 2) (strings)

    题目链接:http://www.codeforces.com/problemset/problem/339/A题意:重新组合加法字符串,使得按照1,2,3的顺序进行排列.C++代码: #include ...

  3. codeforces水题100道 第二十二题 Codeforces Beta Round #89 (Div. 2) A. String Task (strings)

    题目链接:http://www.codeforces.com/problemset/problem/118/A题意:字符串转换……C++代码: #include <string> #inc ...

  4. 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 ...

  5. 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]区间的 ...

  6. 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]( ...

  7. 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 ...

  8. codeforces水题100道 第十六题 Codeforces Round #164 (Div. 2) A. Games (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/268/A题意:足球比赛中如果主场球队的主场球衣和客队的客队球衣颜色一样,那么要求主队穿上他们的可对 ...

  9. 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双袜子, ...

随机推荐

  1. 原创:如何实现在Excel通过循环语句设置指定行的格式

    原创:如何实现在Excel通过循环语句设置指定行的格式 一.需求: 想让excel的某些行(比如3的倍数的行)字体变成5号字 如何整: 二.实现: Sub code() To Range(" ...

  2. 高通 mixer_paths.xml 音频配置文件 初始化过程

    记录一下高通音频配置文件mixer_paths.xml初始化过程.参考代码基于Android O. hardware/qcom/audio/hal/audio_hw.c struct audio_mo ...

  3. Eclipse初次java开发问题总结-4-Maven使用问题汇总

    Non-resolvable parent POM [INFO] Scanning for projects... [ERROR] The build could not read 1 project ...

  4. nodejs基础 -- 全局对象

    全局对象:javascript中的一个特殊对象 全局变量:该特殊对象及其所有属性 该对象为:在浏览器javascript中,为window:在nodejs中,为global(所有全局变量都是globa ...

  5. Python——eventlet.greenthread

    该模块实现 eventlet 中的 “绿色线程” 即协程. 相关的 greenlet 模块的介绍. 目录 一.模块级函数 sleep() spawn() 模块级函数 eventlet.greenthr ...

  6. AOP (面向切面编程)

    AOP (面向切面编程) 留个参考的地址,还没看呢:http://www.cnblogs.com/zhaolb/p/4875167.html

  7. C# Bitmap/png转成jpg格式,压缩图片

    public static ImageCodecInfo GetEncoder(ImageFormat format) { ImageCodecInfo[] codecs = ImageCodecIn ...

  8. 纯CSS3实现的顶部社会化分享按钮

    今天要分享一款纯CSS3实现的社会化分享按钮,它放置在网页的顶部,你可以选择将它固定在网页顶部,这样对用户分享内容就十分方便.这些社会化分享按钮的图标文件来自google和bootstrap的字体文件 ...

  9. MYSQL之You can't specify target table for update in FROM clause解决办法

    mysql中You can't specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表( ...

  10. 3.7 su命令 3.8 sudo命令 3.9 限制root远程登录

    3.7 su命令 3.8 sudo命令 3.9 限制root远程登录 su命令 切换用户 [root@centos_1 ~]# su - xiaobo [root@centos_1 ~]# su - ...