c题库改错与填空

时间:2014-10-09 06:52:34
【文件属性】:
文件名称:c题库改错与填空
文件大小:632KB
文件格式:DOC
更新时间:2014-10-09 06:52:34
全国计算机二级等级考试 #include #include void main() { char s[20]="table left 100",t[20]; /**/ char tab[4,2]={{'a','f'},{'b','e'},{'e','a'},{'f','b'}}; /**/ /* 改为char tab[4][2]={{'a','f'},{'b','e'},{'e','a'},{'f','b'}};*/ int i,j=0; strcpy(t,s); while(t[j]) { for(i=0;i<=3;i++) { if(t[j]==tab[i][0]) { /**/ t[j]=tab[i][2]; /**/ /* 改为t[j]=tab[i][1]; */ break; } } j++; } printf("\nThe source string: %s\n",s); printf("\nThe target string: %s\n",t); getch(); }

网友评论