C language source code of the electronic dictionary Simulation Software

Source: Internet
Author: User

/*
* Copyright (c) 2010, *** Technology Co., Ltd.
* All Rights Reserved.
*
* File name: 201000170.c
* File ID :...... Not submitted | unlinked dictionary | author's test version ..............................
* Abstract: Electronic Dictionary Effect
*
* Version: 2.1
* Author: Wang junliang
* Completion date:
*
* Replace: 2.0
* Original Author: Wang junliang
* Completion date:
*/

# Include <stdio. h>
# Include <string. h>
Void main ()
{
Char * door, word [3];
Void findchinese ();
Void findenglish ();
Door = word;
// Print a banner
Printf ("/T | ********* * *********** |/N ");
Printf ("/T 1. Select the dictionary first: Enter the letter E/C and select either the English or Chinese Dictionary/N ");
Printf ("/T 2. Enter the entry to be queried, press enter to end the input/N ");
Printf ("/T 3. Enter the letter U to return to the main menu and reselect the dictionary/N ");
Printf ("/T 4. Exit: Enter the letter bye in the main menu to exit this electronic dictionary Program/N ");
Printf ("/T ----------- (c) 2010, Zhengzhou Lightning line Technology Co., Ltd. -----------/N ");
Printf ("/T | ******************** All Rights Reserved *********** * ****** |/N ");

While (1) // go to end in the while (...)
{
Printf ("English-Chinese dictionary (e)/Chinese-English Dictionary (c )? ");
Scanf ("% s", door );

// Go to findchinese
If (strcmp (door, "e") = 0)
{
Findchinese (); // function...
}
// Go to findenglish
Else
If (strcmp (door, "C") = 0)
{
Findenglish (); // function...
}
Else // go to the end
If (strcmp (door, "bye") = 0) break;
Else // Error
Printf ("invalid input, please try again ...... /N ");
} // The End Of while (...)
}

// The 1st dictionary
Void findchinese ()
{

Char * P, eword [20] = "R ";
P = eword;
 
While (1)
{
Int f = 0;
Printf ("Enter the English word you want to look up :( enter U to go upper lever)/n ");
Scanf ("% s", P );

// Shocould be checked here .........
If (strcmp (P, "U") = 0) break; // go upper
If (F = 0 & (strcmp (P, "int") = 0) {f = 1; printf ("/n % s: integer/N ", p );}
If (F = 0 & strcmp (P, "float") = 0) {f = 1; printf ("/n % s: Float Type/N ", p );}
If (F = 0 & strcmp (P, "Sunny") = 0) {f = 1; printf ("/n % s: Sunny/N ", p );}
// More words here ^_^
// More words here ^_^ link dictionary | the interface needs to be modified after confirmation...
// More words here ^_^
If (F = 0) printf ("/nsorry, can't find the word/N ");
}
}

 

// The 2nd dictionary
Void findenglish ()
{

Char * P, cword [20] = "R ";
P = cword;
 
 
While (1)
{
Int f = 0;
Printf ("Enter the Chinese words you want to search for: (enter U to return to the upper layer)/n ");
Scanf ("% s", P );

// Shocould be checked here .........
If (strcmp (P, "U") = 0) break; // go upper
If (F = 0 & (strcmp (P, "integer") = 0) {f = 1; printf ("/n % s: int/N ", p );}
If (F = 0 & strcmp (P, "float") = 0) {f = 1; printf ("/n % s: Float/N ", p );}
If (F = 0 & strcmp (P, "Long Integer") = 0) {f = 1; printf ("/n % s: Long/N ", p );}
// More words here ^_^
// More words here ^_^ link dictionary | the interface needs to be modified after confirmation...
// More words here ^_^
If (F = 0) printf ("/n sorry, this Chinese term/N" is not found ");
}
}

Related Article

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.