Chinaunix首页 | 论坛 | 博客
  • 博客访问: 816883
  • 博文数量: 321
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 936
  • 用 户 组: 普通用户
  • 注册时间: 2013-02-23 11:25
文章分类

全部博文(321)

文章存档

2017年(1)

2016年(10)

2015年(61)

2014年(187)

2013年(62)

分类: C/C++

2014-06-24 14:33:11

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

char *dic[][40] = {"luster","A bright shine on the surface.",
        "disgrase", "Loss of honor and respect.",
        "glamour","Strong attraction.",
        "tomb","The place where a dead person is buried.",
        "garbage","Unwanted or spoiled food.",
        "bliss", "Great happiness of joy.",
    "commend","Speak favorably list.",
        "",""
};

int main(int argc, char *argv[])
{
    char word[80], ch;
    char **point;

    do{
        puts("Please enter word:");
        scanf("%s", word);

        point = (char **)dic;
        do{
            if(!strcmp(*point, word))
            {
                puts("The meaning of the word is:");
                puts(*(point+1));
                break;
            }
            if(!strcmp(*point, word))
                break;
            point = point + 2;
        }while(*point);
        if(!*point)
        puts("The word is not in dictionary.");
        printf("Another? (y/n):");
        scanf("%c%*c",&ch);
    }while(toupper(ch) != 'N');


    system("pause");
    return 0;
}


阅读(457) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~