首页 [练习]练习文章打字的编程

[练习]练习文章打字的编程

举报
开通vip

[练习]练习文章打字的编程[练习]练习文章打字的编程 #include #include #include xfk() { char *zq=" ture",*cu="flase",*fs="score"; int i,j,hh=7; textcolor(YELLOW); gotoxy(3,6); cputs(zq); gotoxy(3,11); cputs(cu); gotoxy(3,16); cputs(fs); textcolor(GREEN); for(i=1;i<=3;i++) { gotoxy(3...

[练习]练习文章打字的编程
[练习]练习文章打字的编程 #include #include #include xfk() { char *zq=" ture",*cu="flase",*fs="score"; int i,j,hh=7; textcolor(YELLOW); gotoxy(3,6); cputs(zq); gotoxy(3,11); cputs(cu); gotoxy(3,16); cputs(fs); textcolor(GREEN); for(i=1;i<=3;i++) { gotoxy(3,hh); putch('\311'); for(j=4;j<=7;j++) { gotoxy(j,hh); putch('\315'); } gotoxy(8,hh); putch('\273'); hh=hh+5; } hh=8; for(i=1;i<=3;i++) { gotoxy(3,hh); putch('\272'); gotoxy(8,hh); putch('\272'); hh=hh+5; } hh=9; for(i=1;i<=3;i++) { gotoxy(3,hh); putch('\310'); for(j=4;j<=8;j++) { gotoxy(j,hh); putch('\315'); } gotoxy(8,hh); putch('\274'); hh=hh+5; } textcolor(GREEN); } wcbk() { int thh,tlh; textcolor(WHITE); thh=1; tlh=1; gotoxy(tlh,thh); putch('\332'); for(tlh=2;tlh<=78;tlh++) { gotoxy(tlh,thh); putch('\304'); } gotoxy(tlh,thh); putch('\277'); tlh=1; for(thh=2;thh<=25;thh++) { gotoxy(tlh,thh); putch('\263'); gotoxy(tlh+78,thh); putch('\263'); } thh=25; gotoxy(tlh,thh); putch('\300'); for(tlh=2;tlh<=78;tlh++) { gotoxy(tlh,thh); putch('\304'); } gotoxy(tlh,thh); putch('\276'); textcolor(GREEN); } lcbk() { int thh,tlh; textcolor(YELLOW); thh=3; tlh=10; gotoxy(tlh,thh); putch('\311'); for(tlh=11;tlh<=70;tlh++) { gotoxy(tlh,thh); putch('\315'); } gotoxy(tlh,thh); putch('\273'); tlh=10; for(thh=4;thh<=22;thh++) { gotoxy(tlh,thh); putch('\272'); gotoxy(tlh+61,thh); putch('\272'); } thh=23; gotoxy(tlh,thh); putch('\310'); for(tlh=11;tlh<=70;tlh++) { gotoxy(tlh,thh); putch('\315'); } gotoxy(tlh,thh); putch('\274'); textcolor(GREEN); } zhhs(char lfilename[20]) { int hh=5,lh=13,i,wz=0,cj=4,bj=1,thh,tlh,zq=0,cu=0,fs=0; char *zh,lsslzh,filezh; FILE *fp; if(!(fp=fopen(lfilename,"r"))) {printf("cannot open file\n");exit(1);} while(1) { wcbk(); lcbk(); xfk(); for(i=1;i<=6;i++) { fread(zh,50,1,fp); gotoxy(lh,hh); cputs(zh); hh=hh+3; if(feof(fp)) break; } fseek(fp,wz,0); for(hh=6;hh<=21;hh=hh+3) { for(lh=13;lh<=62;lh++) { bj=1; gotoxy(lh,hh); putch(24); gotoxy(lh,hh); filezh=fgetc(fp); wz=wz+1; if((lsslzh=getch())==27) exit(1); if((lsslzh==8)&&!(hh==6&&lh==13)) { bj=0; if((lh==13)&&(hh!=6)) { putch(' '); lh=62; hh=hh-3; cj=cj-3; } else lh=lh-1; wz=wz-2; gotoxy(lh,hh); putch(' '); gotoxy(lh,cj); putch(' '); gotoxy(lh+1,hh); putch(' '); lh=lh-1; fseek(fp,wz,0); } gotoxy(lh,hh); if(filezh==EOF) return(lsslzh); if(filezh==lsslzh) { putch(lsslzh); fs=fs+5; zq=zq+1; gotoxy(4,8); printf("%2d",zq); gotoxy(4,18); printf("%2d",fs); } else { if(bj) { cu=cu+1; gotoxy(4,13); printf("%2d",cu); gotoxy(lh,hh); textcolor(RED); putch(lsslzh); gotoxy(lh,cj); putch(25); gotoxy(lh,hh); sound(980); delay(100000); nosound(); textcolor(GREEN); } } } cj=cj+3; } delay(2000); textcolor(YELLOW); clrscr(); wz=ftell(fp); hh=5; lh=13; cj=4; } } main() { int thh=3,tlh=10; char zh; char *filename, *lesson="1.College Life\n2.study Online\n3.Lesiure Activity\n4.Living on your own"; window(1,1,20,40); textbackground(BLUE); textcolor(YELLOW); while(1) { clrscr(); printf("%s\n",lesson); printf("choice lesson number:"); zh=getch(); switch(zh) { case 49: filename="e:\\fcp\\college.txt";break; case 50: filename="e:\\fcp\\study.txt";break; case 51: filename="e:\\fcp\\lesiure.txt";break; case 52: filename="e:\\fcp\\living.txt";break; case 27: exit(1); default: printf("enter file name:");scanf("%s",filename); } clrscr(); zhhs(filename); clrscr(); printf("continue practic(y\n):"); if(getch()=='n') break; } }
本文档为【[练习]练习文章打字的编程】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_083599
暂无简介~
格式:doc
大小:24KB
软件:Word
页数:11
分类:
上传时间:2017-09-18
浏览量:121