题目描述

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. webapp开发要点记录

    1. iphone 各机型 机型 分辨率 像素比 物理分辨率 高* 宽 * 后 主屏对角线长度 重量 像素密度(ppi) iphone4/iphone4s 320 * 480 2 640 * 960 ...

  2. HTTP状态301、404、200、304分别表示什么意思

    301 (永久移动)请求的网页已永久移动到新位置.服务器返回此响应(对 GET 或 HEAD 请求的响应)时,会自动将请求者转到新位置.您应使用此代码告诉 Googlebot 某个网页或网站已永久移动 ...

  3. [译]Mongoose指南 - Document

    更新 有几种方式更新document. 先看一下传统的更新方法 Tank.findById(id, function(err, tank){ if(err) return handleError(er ...

  4. 【AngularJS】—— 3 我的第一个AngularJS小程序

    通过前面两篇的学习,基本上对AngularJS的使用有了一定的了解. 本篇将会自己手动写一个小程序,巩固下理解. 首先要注意的是,引用AngularJS的资源文件angular.min.js文件. 由 ...

  5. 黄学长模拟day1 大逃亡

    给出数字N(1<=N<=10000),X(1<=x<=1000),Y(1<=Y<=1000),代表有N个敌人分布一个X行Y列的矩阵上,矩形的行号从0到X-1,列号从 ...

  6. POJ 1905 Expanding Rods

                           Expanding Rods Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 1 ...

  7. BNR Android Demo学习笔记(一)——CrimeIntent

    开发环境:win7,Android Studio 1.2, 1.Model Crime,数据模型,每个Crime有一个UUID作为唯一标识. package tina.criminalintent; ...

  8. Request.ServerVariables 参数大全

    Request.ServerVariables("Url") 返回服务器地址 Request.ServerVariables("Path_Info") 客户端提 ...

  9. iOS开发——网络篇——文件下载(NSMutableData、NSFileHandle、NSOutputStream)和上传、压缩和解压(三方框架ZipArchive),请求头和请求体格式,断点续传Range

    一.小文件下载 NSURL *url = [NSURL URLWithString:@"http://120.25.226.186:32812/resources/images/minion ...

  10. css弹性布局

    1.弹性布局是什么 在移动端一种方便的布局方式,打破了之前用浮动,定位的布局,更加灵活. 2.弹性布局的格式 包含父元素和子元素,有对应的属性应用在父元素和子元素达到布局的目的 3.父元素的属性 要开 ...