電子詞典類比軟體 c語言原始碼

來源:互聯網
上載者:User

/*
* Copyright (c) 2010,****科技有限責任公司
* All rights reserved.
*
* 檔案名稱:201000170.c
* 檔案標識:……未提交 | 未連結詞庫 | 作者測試版…………………………
* 摘    要:電子詞典效果
*
* 目前的版本:2.1
* 作    者:王軍亮
* 完成日期:2010-4-24
*
* 取代版本:2.0
* 原作者  :王軍亮
* 完成日期:2010-4-20
*/

#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.先選擇詞典:輸入字母e/c選擇英漢還是漢英詞典/n");
    printf("/t   2.輸入要查詢的詞條,斷行符號結束輸入/n");
    printf("/t   3.輸入字母u返回主菜單,重新選擇詞典/n");
    printf("/t   4.退出:主菜單下輸入字母 bye 退出此此電子詞典程式/n");
 printf("/t -----------(c) 2010,鄭州閃電行科技有限責任公司----------- /n");
 printf("/t|******************** All rights reserved******************|/n");

 while(1)//go to end in the while(...)
 {
  printf("英漢詞典(e)/漢英詞典(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);

     //should be checked here.........
       if(strcmp(p,"u")==0) break;//go upper
    if(f==0 && (strcmp(p,"int")==0))    {f=1;    printf("/n%s: 整形/n",p);}
    if(f==0 && strcmp(p,"float")==0)  {f=1;    printf("/n%s: 浮點型/n",p);}
    if(f==0 && strcmp(p,"sunny")==0)  {f=1;    printf("/n%s: 陽光燦爛的/n",p);}
    //more words here^_^
    //more words here^_^                連結詞庫 | 介面確定後需要繼續修改...
    //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("請輸入您想尋找的中文詞語:(輸入u返回上層)/n");
     scanf("%s",p);

     //should be checked here.........
        if(strcmp(p,"u")==0) break;//go upper
     if(f==0 && (strcmp(p,"整形")==0))    {f=1;    printf("/n%s: int/n",p);}
      if(f==0 && strcmp(p,"浮點型")==0)    {f=1;    printf("/n%s: float/n",p);}
        if(f==0 && strcmp(p,"長整型")==0)    {f=1;    printf("/n%s: long/n",p);}
     //more words here^_^
     //more words here^_^               連結詞庫 | 介面確定後需要繼續修改...
     //more words here^_^
     if(f==0)   printf("/n很抱歉,沒有找到這個中文詞條/n");
 }
}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.