Quick Brown Fox time limit: 1 Sec memory limit: MB
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
#include <stdio.h>
#include <string.h>
int main ()
{
Char a[53],s[100];
int i,j=0,n,count;
int N;
int book[26];
for (i=0;i<26;i++)
{
A[i]= ' a ' +i;
}
for (i=26;i<52;i++)
{
a[i]= ' A ' +i-26;
}
printf ("%c\n", a[51]);
Puts (a);
scanf ("%d", &n);
while (n--)
{
GetChar ();
Gets (s);
N=strlen (s);
for (i=0;i<26;i++)
book[i]=0;
for (i=0;i<n;i++)
{
for (j=0;j<52;j++)
{if (s[i]==a[j]&&j<26)
book[j]++;
if (s[i]==a[j]&&j>=26)
book[j-26]++;
}
}
for (i=0;i<26;i++)
printf ("%d", book[i]);
for (i=0;i<26;i++)
{
if (book[i]!=0)
count++;
}
if (count==26)
printf ("pangram\n");
if (count!=26)
{
printf ("Missing");
for (i=0;i<26;i++)
{
if (book[i]==0)
printf ("%c", A[i]);
}
printf ("\ n");
}
}
return 0;
}
Quick Brown Fox