Home > Back-end >  3 C language program design input one two output
3 C language program design input one two output

Time:12-07

C language program design input English Numbers together, the output of Arabic numerals,
Such as:
Input: one plus two equals
Output: 3
Thank you for the great god!
To help

CodePudding user response:

Store a dictionary, the Numbers are in, such as 0-9, hundred, thousand, million, etc

CodePudding user response:

At least their first try to write, debug debugging, not how to understand and learn ~

CodePudding user response:

The scanf ();
Printf (" 3 ");

CodePudding user response:

Declare an enumeration variable, the one, two... And 1, 2,... correspond

CodePudding user response:

Can design a database, a fixed number of English and relationship, reading the database from the input data splicing into digital computing

CodePudding user response:

Typedef one 1;
Typedef two 2;
.
Int result=one plus two

CodePudding user response:

refer to the original poster zhou20001203 response:
C language program design input English Numbers together, the output of Arabic numerals,
Such as:
Input: one plus two equals
Output: 3
Thank you for the great god!
Help


Whether to have more specifications, for example, data range, etc., because the range of possible application difficulty is not the same,
Perhaps with a few typical test cases,

CodePudding user response:

 # include 
# define one 1
# define two 2
# define three 3
# define four 4
Int main ()
{
Printf (" % d ", one and two);
}

CodePudding user response:

Code inside make judgment, and analysis of contrast the input character is equal to one is 1, two is two,,, not like this?
  • Related