Title Description A pangram is a phrase this includes at least one occurrence of each of the letters, ' a ' ... ' Z '. You ' re probably familiar with this one: "The quick brown fox jumps over the the lazy dog."
Your job is to recognize Pangrams. For phrases that's don ' t contain every letter, the report what letters is missing. We'll say that a particular letter occurs in the phrase if it occurs as either upper case or lower case. Enter input starts wit H a line containing an integer 1≤n≤50. The next N lines is each a single phrase,possibly containing upper and lower case letters, spaces, decimal digits and pun Ctuation characters '. ', ', ', '? ', '! ', ' and '. Each phrase contains at least one and no more than characters. Outputs for each input phrase, output "pangram" if it quali?es 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 is reported in lower cases and should be sorted alphabetically. Sample input
3The quick brown fox jumps over the lazy dog. Zyxw, vu TSR ponm lkj ihgfd CBA:,?! ' " 92384 ABCDE Fghij
Sample output
Pangrammissing eqmissing klmnopqrstuvwxyz
Tips for solving problems:
The title means, enter a line of characters (the case can be), to determine whether it is "full-letter short", is the output pangram, otherwise the output missing plus the missing letters;
This is titled Water problem, but I did it for a long time, the main reason is after writing has been looking for the wrong, the results finally found that the output is wrong.
Always make some low-level mistakes, absent-minded result in vain to pay a lot of time.
Code:
1#include <iostream>2#include <cstring>3#include <cstdio>4 using namespacestd;5 intb[ -];6 7 void is(CharA_z[],Chara) {8 intII;9 for(ii=0;ii< -; ii++){Ten if(a==a_z[ii]| | a==a_z[ii]- +){ Oneb[ii]=1; A } - } - } the - intMain () - { - intN; + intj=0; - Chara[ the]; + Chara_z[ -]; Astrcpy (A_z,"abcdefghijklmnopqrstuvwxyz"); atmemset (b,0, -*sizeof(int)); -scanf"%d",&n); - GetChar (); - for(intI=0; i<n;i++){ -j=0; -Memset (A,' /', the*sizeof(Char)); in gets (a); - for(intI2=0; a[i2]!=' /'; i2++){ to is(A_z,a[i2]); + } - for(inti3=0;i3< -; i3++){ the if(b[i3]==0){ *J + +; $ }Panax Notoginseng } - if(j==0){ theprintf"pangram\n"); + } A Else{ theprintf"missing"); + for(intj1=0;j1< -; j1++){ - if(b[j1]==0){ $printf"%c", a_z[j1]); I wrote a_z A, the results for a long time did not find fault!! $ } - } -printf"\ n"); the } -memset (b,0, -*sizeof(int));Wuyi the } - intAB; WuCin>>AB; - return 0; About}
2076 problem F Quick Brown Fox