当前位置:三九宝宝网 → 宝宝教育 → 教学论文 → 正文

C语言编写电子词典要求用户输入十个单词和释义然后系统排序

更新:02-02 整理:39baobao.com
字体:

[2012最新网络流行语及释义]屌丝 diaosi 该词起源于足球运动员李毅的贴吧(国内知名的BBS)。李毅的球迷“毅丝”们在贴吧里不仅谈论足球,还抱怨自己对生活、工作与感情的不满。 “毅丝”以语言粗鲁,脏话连篇...+阅读

#include "stdio.h" #include "string.h" #define N_1 3 #define N_2 20 #define N_3 200 int i,j; /**************************************/ int strccmp(char *str1,char *str2) { int len; int len_1=strlen(str1); int len_2=strlen(str2); for(i=0;str1[i]!='\0';i++) { if(str1[i]>='A'&str1[i]='A'&str2[i]len_2?len_2:len_1; for(i=0;i{ if(str1[i]>str2[i]) { return 1; } else if(str1[i] } if((len_1!=len_2)&(len_1>len_2)) { return 1; } else if((len_1!=len_2)&(len_1 else { return 0; } } /**************************************/ void sort(char words[][N_2],char comments[][N_3]) { int i,j; char temp_1[N_2]; char temp_2[N_3]; for(i=0;i { for(j=i+1;j { if(strccmp(words[i],words[j])==1) { strcpy(temp_1,words[i]); strcpy(words[i],words[j]); strcpy(words[j],temp_1); strcpy(temp_2,comments[i]); strcpy(comments[i],comments[j]); strcpy(comments[j],temp_2); } } } } /**************************************/ int search(char *key,char words[][N_2]) { int bot=0; int top=N_1-1; int mid; while(bot

本文地址:https://www.39baobao.com/show/29_34431.html

以上内容来自互联网,请自行判断内容的正确性。若本站收录的信息无意侵犯了贵司版权,请联系我们,我们会及时处理和回复,谢谢.