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][ ...
随机推荐
- Unity调试相关
1.LOG处理 将所有LOG信息写入到文件,并设置部分LOG显示到屏幕上,总结成以下脚本,将其挂载在摄像机上即可. using UnityEngine; using System.Collection ...
- 记录在xx公司被考核的15天及自己的感想
在大学有两件事让我很遗憾. 第一:在2013年7月我和自己的前任女朋友分手,这是两年前的事了,我们谈了七个月. 第二:在2015年4月我被xx公司淘汰了,正如我的前任女朋友是我遇到的最好女孩,这家公司 ...
- 腾讯web前端笔试题及个人答案
每道题都有答案,大多数答案亲测正确. 简答题 1.js中“5”+4=? 答案:54 2.js中void(0)=? 答案:undefined 3.js中NaN*4=? 答案:NaN 4.js中null* ...
- 黑客攻防技术宝典Web实战篇(一)Web应用程序技术基础
在开展Web应用程序渗透测试之前请先了解下面列出的这些内容,如果不是很懂的话,请读David Gourley & Brian Totty的HTTP权威指南也叫HTTP:The Definiti ...
- [译]git rebase -i
使用rebase -i会在终端出现一个交互页面. 在这个交互页面中我们可以对要rebase的commit做一定的修改. 用法 git rebase -i <master> 把当前的分支的c ...
- handsontable学习
http://blog.csdn.net/mafan121/article/category/3273599
- vc++6.0各种报错合集(附:VC++6.0调出打印窗口的方法)
背景: 由于VC++6.0对于现在的我来说,只是一个工具,暂时没有太多的时间分配到这块去深究它,由于不明其原理,因此也只是在此把错误积累下来,以备下次相同错误出现时能快速排除,节省时间. 正文 一.出 ...
- hibernate之persistence错误
错误码: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityM ...
- 二、 显示加载数据过程的JS
- php DI实现实例:
<?php //DI 主要运用IoC用于解决 依赖文件共享(无需每一个依赖都手动注册) //管理应用程序中的『全局』对象(包括实例化.处理依赖关系). //可以延时加载对象(仅用到时才创建对象) ...