2076 Problem F Quick Brown Fox
题目描述

A pangram is a phrase that includes at least one occurrence of each of the 26 letters, ‘a’. . .‘z’. You’re probably familiar with this one: “The quick brown fox jumps over the lazy dog.”
Your job is to recognize pangrams. For phrases that don’t
contain every letter, report what letters are missing. We’ll say that a
particular letter occurs in the phrase if it occurs as either upper case or
lower case.
输入
containing an integer 1 ≤ N ≤ 50. The next N lines are each a single
phrase,possibly containing upper and lower case letters, spaces, decimal digits
and punctuation characters ‘.’,‘,’, ‘?’, ‘!’, ‘’’ and ‘"’. Each phrase contains
at least one and no more than 100 characters.
输出
“pangram” if it qualifies as a pangram. Otherwise, output the word “missing”
followed by a space and then the list of letters that didn’t occur in the
phrase. The list of missing letters should be reported in lower case and should
be sorted alphabetically.
样例输入
3
The quick brown fox jumps over the lazy dog.
ZYXW, vu TSR Ponm lkj ihgfd CBA.
.,?!’" 92384 abcde FGHIJ
样例输出
pangram
missing eq
missing klmnopqrstuvwxyz 解题心得:
题目的意思是,输入一行字符(大小写皆可),判断是否为“全字母短句”,是则输出pangram,否则输出missing 加缺少的字母;
此题为水题,但是我却做了很久,主要原因是写完后一直在找错,结果最后发现输出错了。
老是犯些低级错误,丢三落四结果导致白白付出很多时间。
代码:
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int b[]; void is(char a_z[],char a){
int ii;
for(ii=;ii<;ii++){
if(a==a_z[ii]||a==a_z[ii]-){
b[ii]=;
}
}
} int main()
{
int n;
int j=;
char a[];
char a_z[];
strcpy(a_z,"abcdefghijklmnopqrstuvwxyz");
memset(b,,*sizeof(int));
scanf("%d",&n);
getchar();
for(int i=;i<n;i++){
j=;
memset(a,'\0',*sizeof(char));
gets(a);
for(int i2=;a[i2]!='\0';i2++){
is(a_z,a[i2]);
}
for(int i3=;i3<;i3++){
if(b[i3]==){
j++;
}
}
if(j==){
printf("pangram\n");
}
else{
printf("missing ");
for(int j1=;j1<;j1++){
if(b[j1]==){
printf("%c",a_z[j1]); //我把a_z写成了a,结果好久好久都没找出错误来!!
}
}
printf("\n");
}
memset(b,,*sizeof(int)); }
int ab;
cin>>ab;
return ;
}
2076 Problem F Quick Brown Fox的更多相关文章
- the quick brown fox jumps over the lazy dog
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
- Quick Brown Fox
The quick brown fox jumps over the lazy dog
- 实验12:Problem F: 求平均年龄
Home Web Board ProblemSet Standing Status Statistics Problem F: 求平均年龄 Problem F: 求平均年龄 Time Limit: ...
- The Ninth Hunan Collegiate Programming Contest (2013) Problem F
Problem F Funny Car Racing There is a funny car racing in a city with n junctions and m directed roa ...
- Codeforces Gym 100500F Problem F. Door Lock 二分
Problem F. Door LockTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/at ...
- Codeforces Gym 100002 Problem F "Folding" 区间DP
Problem F "Folding" Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/ ...
- Codeforces Gym 100286F Problem F. Fibonacci System 数位DP
Problem F. Fibonacci SystemTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudg ...
- Problem F: Exponentiation
Problem F: ExponentiationTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 4 Solved: 2[Submit][Status][W ...
- Problem F: 合唱比赛开始了!
Problem F: 合唱比赛开始了! Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 440 Solved: 201[Submit][Status][ ...
随机推荐
- R 字符串处理函数
用R来处理字符串数据并不是一个很好的选择,还是推荐使用Perl或者Python等语言.不过R本身也提供了一些常用的字符串处理函数,这篇文章就对这些字符串函数做一个简单的总结,具体各个函数的使用方法还是 ...
- ConcurrentHashMap-----不安全线程hashmap-安全线程-hashtable
JDK1.0引入了第一个关联的集合类HashTable,它是线程安全的.HashTable的所有方法都是同步的.JDK2.0引入了HashMap,它提供了一个不同步的基类和一个同步的包装器synchr ...
- 15个关于Chrome的开发必备小技巧
一.快速查找文件 如果你使用过Sublime,那么你会知道’Go to anything’的强大.没错,Chrome现在也有了这一功能. 操作如下: 1.F12打开你的Chrome调试器: 2.按下C ...
- Python的Set和List的性能比较 + 两者之间的转换
1.能用set 不用list ~$ python -m timeit -n 1000 "[x for x in range(1000) if x in range(500, 1500)]&q ...
- Ubuntu 14 如何创建软件的 启动器/桌面图标?
如题所示:Ubuntu 14 如何创建软件的 启动器/桌面图标? 解决方案: 将 /usr/share/applications/ 里面的相应图标复制到桌面即可. 同理,也可“拖动”到左边的“启动器栏 ...
- 第三天 moyax
struct Blog { static let BaseURL = NSURL(string: "http://192.168.1.103/blog")! } extension ...
- tcl调用tuxedo的一个demo
Tuxedo是Oracle的一个商业中间件,一般用于通信. 如下是一个简单的调用tuxedo的so动态库实现,编译后,tcl脚本可以加载并调用这个so库实现对tuxedo的调用. 1. 代码例子,保存 ...
- java历史
1.产生: 1990年初sun公司James Gosling等员工开发java语言的雏形,最初被命名为Oak,定位于家用电器的控制和通讯,随后因为市场的需求,公司放弃计划,后面由于Internet的发 ...
- HDU1102(最小生成树Kruskal)
开学第三周.........真快尼 没有计划的生活真的会误入歧途anytime 表示不开心不开心不开心 每天都觉得自己的生活很忙 又觉得想做的事又没有完成 这学期本来计划重点好好学算法,打码码,臭臭美 ...
- BZOJ1146——[CTSC2008]网络管理Network
1.题目大意:就是在动态的树上路径权值第k大. 2.分析:这个就是树链剖分+树套树 #include <cstdio> #include <cstdlib> #include ...