HDU-2573-Typing
题目链接
http://acm.hdu.edu.cn/showproblem.php?pid=2573
这题把%s与gets()的输入法搞混了一直感觉没有错,就是找不出哪里错了,
题目思路不是很难。
直接看代码
#include<stdio.h>
#include<string.h>
int main(void)
{
char s[10];
int l,i,j,flag;
int t,n;
scanf("%d",&t);
while(t--)
{
flag=0;
j=0;
scanf("%d",&n);
getchar();
while(n--)
{
gets(s);
l=strlen(s);
if(l==1)
{
if(flag)
printf("%c",s[0]-32);
else
printf("%c",s[0]);
}
else if(l==4)
{
flag=!flag;
}
else
{
if(flag)
printf("%c",s[6]);
else
printf("%c",s[6]-32);
}
}
printf("\n");
}
return 0;
}
如果熟悉sscanf()的也可以这样做
#include<stdio.h>
HDU-2573-Typing的更多相关文章
- HDU 2577
How to Type Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tota ...
- HDU 2577---How to Type
HDU 2577 Description Pirates have finished developing the typing software. He called Cathy to test ...
- HDU 2577 分情况多维DP
How to Type Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- HDU 1298 T9【字典树增加||查询】
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=1298 T9 Time Limit: 2000/1000 MS (Java/Others) Memo ...
- hdu 2578 Dating with girls(1) (hash)
Dating with girls(1) Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth ...
- HDU 2578 Dating with girls(1) [补7-26]
Dating with girls(1) Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth ...
- HDU 2577 How to Type (线性dp)
How to Type Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tota ...
- Python标准库--typing
作者:zhbzz2007 出处:http://www.cnblogs.com/zhbzz2007 欢迎转载,也请保留这段声明.谢谢! 1 模块简介 Python 3.5 增加了一个有意思的库--typ ...
- 最牛的打字效果JS插件 typing.js
最新在做公司的一个项目,需要实现一个敲打代码的动画效果,粗意味比较简单,果断自己直接开写,写着写着发现是一个坑.需要支持语法高亮,并不能直接简单的用setTimeout来动态附件innerHTML.苦 ...
- Monkey Patch/Monkey Testing/Duck Typing/Duck Test
Monkey Patch Monkey Testing Duck Typing Duck Test
随机推荐
- 单源最短路-dijkstra算法(未优化)
bool used[maxn]; int g[maxn][maxn]; // 边未联系的填充为INF int d[maxn]; void dijkstra(int s){ memset(g,false ...
- 转 如何使用JEE6快速开发简单的webservice
转自:http://www.iteye.com/topic/1135747,作者:红尘默岩 前言:朋友们开始以下教程前,请先看第五大点的注意事项,以避免不必要的重复操作. 一.准备工作(以下为本实例使 ...
- zookeeper启动失败
集群中3个节点,第一个started,第二个说Starting zookeeper ... already running as process xxxx,第三个说Starting zookeeper ...
- IFields Interface 定义一个字段集合对象
Description The Fields object represents a collection of columns in a table. The term field is synon ...
- Zabbix的安装及简单配置
Mysql源码安装:Mysql安装脚本 PHP源码安装:基于LNMP的Zabbbix之PHP源码安装 Nginx源码安装:Nginx安装 Zabbix监控端源码安装(包含Server和Agent):l ...
- iOS面向对象的建模:MVC(OC基础)
本文转发至:http://www.cnblogs.com/tmf-4838/p/5294036.html 实例化一个类:从plist文件抽取出类 @interface Person : NSObjec ...
- javadoc时候乱码-编码 GBK 的不可映射字符 - wqjsir的专栏 - 博客频道 - CSDN.NET
body { font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI ...
- Oracle GoldenGate 异构平台同步(Mysql到Oracle)
一.OGG安装配置(源端) 1.OGG下载 http://www.oracle.com/technetwork/cn/middleware/goldengate/downloads/index.htm ...
- (中等) POJ 3660 Cow Contest,Floyd。
Description N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming con ...
- url语法
URL的主要部分 URL通常被写成如下形式: <方案>:<方案描述部分> 一个URL包含了它使用的方案名称(<方案>), 其后紧跟一个冒号,然后是一个字符串 (&l ...