c语文编程提取郑码的单字码表
生活随笔
收集整理的這篇文章主要介紹了
c语文编程提取郑码的单字码表
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
incode.txtson文件鏈接:https://pan.baidu.com/s/1ZNpe0bZJcMPPQYKo97Y9OQ 提取碼:22br
1.代碼如下:
#include <stdio.h> #include <stdlib.h> #include <string.h>int main() {FILE *fp;char ch,index[10];int i=0;printf("please input the filename:");if (!(fp=fopen("incode.txt","r"))){printf("Failed to open file");exit(0);}scanf("%s",index);char str[20];char strChina[4];int k=0;int c;int flat = 1;while(ch != EOF){ch=fgetc(fp);if(ch>='a'&&ch<='z'){flat = 1;str[k] = ch;k++;}else if(ch == ' ' && flat == 1){flat = 0;str[k] = '\0';c = k = 0;if(strcmp(str,index) == 0){while(1){ch=fgetc(fp);if(ch == ' ' || ch >=3)break;strChina[c] = ch;c++;}strChina[c] = '\0';if(c == 2){printf("%s",strChina);} break;}}}fclose(fp);return 0; }2.TCC編譯后輸出
總結
以上是生活随笔為你收集整理的c语文编程提取郑码的单字码表的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 什么是“小小输入法”软件? 用其进行郑码
- 下一篇: 小小输入法码表