Quick Brown Fox

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.