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][ ...
随机推荐
- php中pdo例子
下面是从其他博客看到的代码 <?php $dbh = new PDO('mysql:host=localhost;dbname=access_control', 'root', ''); $db ...
- PHP获取MAC地址的函数代码
获取网卡的MAC地址原码;目前支持WIN/LINUX系统 获取机器网卡的物理(MAC)地址 复制代码 代码如下: <?php /** 获取网卡的MAC地址原码:目前支持WIN/LINUX系统 ...
- Mastering Web Application Development with AngularJS 读书笔记(一)
第一章笔记 (一) 一.PS:运行时配置IIS <html> <head> <script src="angular.js"></scri ...
- [译]git reset
git reset 如果说git revert是一个安全的撤销方式, 那么git reset就是一个非常危险的方法了. 当你使用git reset撤销的时候, 你没有可能在回到最初了-他是一个永久的不 ...
- 跨域攻击xss
要完全防止跨域攻击是很难的,对于有些站点是直接 拦截跨域的访问,在你从本站点跳转到其他站点时提醒,这算是一种手段吧. 而跨域攻击的发起就是在代码(包括html,css,js或是后台代码,数据库数据)里 ...
- MAS 移动业务整合系统
AppCan MAS是基于高性能NODEJS架构开发的企业移动后端整合系统,内置各种标准协议组件,统一移动业务前后端标准开发技术:同时通过基于策略配置的数据缓存机制,聚合业务数据并发连接不同的后端业务 ...
- 字符集与编码01--charset vs encoding
声明:此文章转载自 http://my.oschina.net/goldenshaw/blog/304493 许多时候,字符集与编码这两个概念常被混为一谈,但两者是有差别的,作为深入理解的第一步,首先 ...
- 热更新脚本C#light,ulua,Scorpio性能比较
http://www.unity蛮牛.com/thread-32861-1-1.html 测试环境: unity4.5.2 三个脚本全是源码导入 PC :处理器 Intel(R) Core(TM) ...
- thinkphp的CURD操作
增 //a字段是主键 $data['b'] = 'bbb'; $data['c'] = 'c'; $new_id = M('test')->data($data)->add(); //ec ...
- aspcms 留言 搜索
留言: <form method='POST' name='myform' onSubmit='return metmessagesubmit("姓名不能为空"," ...