11862 - getchar practice   

Description

In this practice,you need to write a function isNumber to determine whether the composition of the input strings are all 0~9 or all a~z.

isNumber function returns 1 if the composition of the input string is all 0~9.

isNumber function returns 0 if the composition of the input string is all a~z.

You should use getchar() to get all characters of input string, and remember to return it to stdin because we will get the input string again using scanf in judgeA and judgeB functions.

Note that

1.      This problem involves three files.

  • function.h: Function definition of isNumber and other functions.
  • function.c: Function describe of isNumber.
  • main.c: A driver program to test your implementation and describe of other functions.

 

You will be provided with main.c and function.h, and asked to implement function.c.

2.     For OJ submission:

       Step 1. Submit only your function.c into the submission block.

       Step 2. Check the results and debug your program if necessary.

 

hint: the format of function.c should be like:

#include<stdio.h>

int isNumber(){

       // write your code here...

}

Input

Input is a number in the first line and then some strings in the next several lines. The number N(1<=N<=10) in the first line denotes the number of input strings. There are just two types of input string: all 0~9 & all a~z(not include capital letter), and the size of each string is not larger than 100.

Output

There should be N lines in the output.

At each line, print "OK!Number" if the composition of the string is all 0~9.

Print "OK!Word" if the composition of the string is all a~z.

Note that:

In this problem, you don't need to write printf() function because it has been already written in main.c.

You only need to return 0 or 1 in isNumber() function.

Sample Input  Download

Sample Output  Download

Partial Judge Code

11862.c

Partial Judge Header

11862.h

Tags




Discuss