题目描述

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.

输入

Input starts with a line
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.

输出

For each input phrase, output
“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的更多相关文章

  1. the quick brown fox jumps over the lazy dog

    THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG

  2. Quick Brown Fox

    The quick brown fox jumps over the lazy dog

  3. 实验12:Problem F: 求平均年龄

    Home Web Board ProblemSet Standing Status Statistics   Problem F: 求平均年龄 Problem F: 求平均年龄 Time Limit: ...

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

  5. Codeforces Gym 100500F Problem F. Door Lock 二分

    Problem F. Door LockTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/at ...

  6. Codeforces Gym 100002 Problem F "Folding" 区间DP

    Problem F "Folding" Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/ ...

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

  8. Problem F: Exponentiation

    Problem F: ExponentiationTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 4 Solved: 2[Submit][Status][W ...

  9. Problem F: 合唱比赛开始了!

    Problem F: 合唱比赛开始了! Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 440  Solved: 201[Submit][Status][ ...

随机推荐

  1. css外边距合并和z-index的问题

    参考这篇文章, 将外边距的 折叠 参考这篇文章, 将bfc的生成, bfc的应用 参考这篇文章 position: absolute的元素, 仍然具有内填充padding和border边框属性样式, ...

  2. 在linux命令行中直接执行php命令

    有时候用浏览器调试太麻烦,想在linux命令下直接执行php代码 php -r 'echo 0500;'

  3. 论Linux运维的一些基础安全知识和简单办法

    不知不觉本人来北京也已经第三个年头了,从一个Linux小小鸟,开始,2012年我参加了第一份工作,其实现在想想其实我是幸运的,本来求学的时候,就没好好的学Linux,我认为有Cisco知识从上wind ...

  4. OB函数

    ob_start                    打开输出控制缓冲 ob_get_contents        返回输出缓冲区内容 ob_clean                   清空( ...

  5. NHibernate配置

    因为NHibernate被设计为可以在许多不同环境下工作,所以它有很多配置参数.幸运的是,大部分都已经有默认值了. NHibernate.Test.dll包含了一个示例的配置文件app.config, ...

  6. OC第四节——NSDictionary和NSMutableDictionary

    NSDictionary    1.什么是字典        字典是也是一种集合结构,功能与我们现实中的字典工具一样    2.字典的元素是什么        任意类型的对象地址构成键值对    3. ...

  7. PHP的$_SERVER['PHP_SELF']造成的XSS漏洞攻击及其解决方案

    $_SERVER['PHP_SELF']简介 $_SERVER['PHP_SELF'] 表示当前 PHP文件相对于网站根目录的位置地址,与 document root 相关. 假设我们有如下网址,$_ ...

  8. C#爬虫之~苏飞万能框架使用教程

    苏飞的框架帮助类,很多人应该都知道,不知道可以百度,此处直接说用法. //引入命名空间 using CsharpHttpHelper; //创建Httphelper对象 HttpHelper http ...

  9. 部署Apache网站访问统计-AWStats分析系统

    环境根据:http://www.cnblogs.com/zzzhfo/p/5925786.html 1.安装AWStats软件包 将软件包解压到httpd服务器中的/usr/lcoal/目录下 [ro ...

  10. HDU 4930 Fighting the Landlords(模拟)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4930 解题报告:斗地主,加了一个四张可以带两张不一样的牌,也可以带一对,判断打出一手牌之后,如果对手没 ...