|
||||||||||
Count The KeywordTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 249 Accepted Submission(s): 45 Problem Description John loves various languages. Recently he begins to learn C programming language. He is interested in the keyword of C and knows the importance of keywords. So each time he gets a C program source code, he counts the the appearance of the valid keyword first. However, when the code is long, John can't count it correctly. Now he needs your help, he will give you some C code, and he wants you tell him the correct number of the appearance of the keyword. In order to make the problem easier. John provides you some information. 1, the code don't contain "#define", i.e. the code don't contain the Macro definition . 2, the code may contain type cast, i.e. int a = (int)b; 3, the keywords in the comments are not valid. 4, the keywords in a string are not valid, and the character in the string will be expressed by letter. i.e. The string like "ab\x40" will not appear. 5, it guarantees that a word or a statement is in the same line, but one line may contain many words or statements. 6, one line contain no more than 300 characters and one word is less than 50 characters. Input The input file contains no more than 10 cases. Each case contains a completely or incompletely correct C program and cases are separated by a line contains only four '#', i.e. "####". Output Each case outputs a number which is the sum of the Keyword appears. Sample Input
Sample Output
Hint Below is the 32 keywords in C language. auto break case char const continue default do double else enum extern float for goto if int long register return short signed static sizeof struct switch typedef union unsigned void volatile while Source | ||||||||||
|