问题3284--Count The Keyword

3284: Count The Keyword

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 64 MB

题目描述

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.

输入

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. "####".

输出

Each case outputs a number which is the sum of the Keyword appears.

样例输入 Copy

#include <stdio.h>
main(){
int a;
int b;
scanf("%d%d",&a,&b);
printf("%d\n",a+b);
}

样例输出 Copy

2

 

提示

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