课程设计之打字练习程序
2008-03-08 12:26:31 来源:WEB开发网核心提示:老菜鸟(不足之处,请多指教)#include"dos.h"#include"conio.h"#include"stdio.h"#include"stdlib.h"#define N 81void init()void count(float
老菜鸟
(不足之处,请多指教)
#include"dos.h"
#include"conio.h"
#include"stdio.h"
#include"stdlib.h"
#define N 81
void init()
void count(float hits,float corrects,float errors,float score)
{float z;
window(1,1,80,4);
z=(hits-corrects-errors)/2;
textcolor(1);
gotoxy(16,2);cPRintf("%2.0f",hits);
gotoxy(34,2);cprintf("%2.0f",corrects);
gotoxy(48,2);cprintf("%2.1f",errors+z);
if(hits>0) score=corrects/(corrects+errors+z)*100;
gotoxy(62,2);cprintf("%3.2f",score);
window(1,4,80,25);
}
void createster(char *str1,char *str2,int row)
{int c,i;
randomize();
for(i=0;i<80;i++)
{c=random(26)+65;
str1[i]=c;
str1[++i]=' ';
}
str1[80]='
#include"conio.h"
#include"stdio.h"
#include"stdlib.h"
#define N 81
void init()
void count(float hits,float corrects,float errors,float score)
{float z;
window(1,1,80,4);
z=(hits-corrects-errors)/2;
textcolor(1);
gotoxy(16,2);cPRintf("%2.0f",hits);
gotoxy(34,2);cprintf("%2.0f",corrects);
gotoxy(48,2);cprintf("%2.1f",errors+z);
if(hits>0) score=corrects/(corrects+errors+z)*100;
gotoxy(62,2);cprintf("%3.2f",score);
window(1,4,80,25);
}
void createster(char *str1,char *str2,int row)
{int c,i;
randomize();
for(i=0;i<80;i++)
{c=random(26)+65;
str1[i]=c;
str1[++i]=' ';
}
str1[80]='
更多精彩
赞助商链接