91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 450.69 KB
    文件類型: .rar
    金幣: 1
    下載: 0 次
    發布日期: 2024-09-29
  • 語言: C/C++
  • 標簽: C語言??打字游戲??

資源簡介

這是我自己寫的一個用C語言寫的打字游戲,但我沒有做它的界面,但實現了打字游戲的基本算法。希望能幫到需要的人。

資源截圖

代碼片段和文件信息

#include“stdio.h“
#include“stdlib.h“
#include“math.h“
#include“string.h“
#include“conio.h“
#include?“windows.h“
#include?“time.h“
char?path[20];
char?*p;
int?xy;
int?countwrongcount;
void?setposition(int?xint?y)
{
????HANDLE?hOut;
COORD?pos;
hOut=GetStdHandle(STD_OUTPUT_HANDLE);
????pos.X=x;
pos.Y=y;??????????????????????????????????????????
SetConsoleCursorPosition(hOutpos);
}
char?bkchar(char*?p)
{
long?mysizes;
long?k;
mysizes=strlen(p);
srand(time(NULL));?
k=rand()%(mysizes-1);
return?p[k];
}
void?type(?)
{
x=0;
y=0;
count=0;
wrongcount=0;
char?chgchar;
int?hourminutesecondhour_tminute_tsecond_t;
struct?tm?*gtime;
struct?tm?*gtime_t;
????time_t?ltime;
time(?<ime?);
gtime?=?gmtime(?<ime?);
hour=(*gtime).tm_hour;
minute=(*gtime).tm_min;
second=(*gtime).tm_sec;
system(“cls“);
????do
{
setposition(5*xy);
????ch=bkchar(p);
????printf(“%c\r“ch);
gchar=getch();
if(gchar!=ch)
{
wrongcount++;
puts(“\a“);
}
x++;
if(x==10)
{
y=y+4;
x=0;
}
count++;
}while(gchar!=‘?‘);
time(?<ime?);
gtime_t?=?gmtime(?<ime?);
hour_t=(*gtime_t).tm_hour;
minute_t=(*gtime_t).tm_min;
second_t=(*gtime_t).tm_sec;
????setposition(0y+2);
printf(“%d%d\n“wrongcount-1count);
printf(“%d:%d:%d\n“hour_t-hourminute_t-minutesecond_t-second);
}

void?main()
{
FILE?*fp;
long???fsizes;
????printf(“Please?input?the?document‘s?path?that?the?you?want?to?encrypt:“);
scanf(“%s“&path);
fp=fopen(path“r+“);
fseek(fp02);?????
????fsizes=ftell(fp);
char?*s;
char?*s_t;
char?ch;
s=(char?*)malloc(sizeof(char)*fsizes);?
s_t=(char?*)malloc(sizeof(char)*fsizes);
p=s_t;
????if(fp==NULL)
{?
printf(“The?file?can‘t?open“);
exit(0);
}
else
{
fp=fopen(path“r+“);
fgets(sfsizes+1fp);
while(fsizes)
{
???????????ch=char(fabs(*s));
???if((ch>43)&&(ch<58)||((ch>96)&&(ch<123))||(ch==61)||((ch>90)&&(ch<94)))
???{
???*s_t=ch;
???????????????s_t++;
???}
???s++;
???fsizes--;
}
*s_t=‘\0‘;
// puts(p);
type();
}
fclose(fp);
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????2147??2009-07-20?13:20??打字游戲\1\1.cpp

?????文件???????3341??2009-07-20?12:58??打字游戲\1\1.dsp

?????文件????????527??2009-07-20?13:35??打字游戲\1\1.dsw

?????文件??????41984??2009-07-20?13:35??打字游戲\1\1.ncb

?????文件??????48640??2009-07-20?13:35??打字游戲\1\1.opt

?????文件????????717??2009-07-20?13:31??打字游戲\1\1.plg

?????文件?????217160??2009-07-20?13:31??打字游戲\1\Debug\1.exe

?????文件?????267688??2009-07-20?13:31??打字游戲\1\Debug\1.ilk

?????文件??????16878??2009-07-20?13:31??打字游戲\1\Debug\1.obj

?????文件?????230084??2009-07-18?23:31??打字游戲\1\Debug\1.pch

?????文件?????582656??2009-07-20?13:20??打字游戲\1\Debug\1.pdb

?????文件?????140288??2009-07-20?13:31??打字游戲\1\Debug\vc60.idb

?????文件??????77824??2009-07-20?13:20??打字游戲\1\Debug\vc60.pdb

?????文件????????244??2009-07-19?06:28??打字游戲\2\2.cpp

?????文件???????3341??2009-07-19?06:26??打字游戲\2\2.dsp

?????文件????????527??2009-07-19?07:19??打字游戲\2\2.dsw

?????文件??????41984??2009-07-19?07:19??打字游戲\2\2.ncb

?????文件??????48640??2009-07-19?07:19??打字游戲\2\2.opt

?????文件????????717??2009-07-19?06:36??打字游戲\2\2.plg

?????文件?????163912??2009-07-19?06:36??打字游戲\2\Debug\2.exe

?????文件?????179288??2009-07-19?06:36??打字游戲\2\Debug\2.ilk

?????文件???????2298??2009-07-19?06:36??打字游戲\2\Debug\2.obj

?????文件?????224196??2009-07-18?23:33??打字游戲\2\Debug\2.pch

?????文件?????394240??2009-07-19?06:29??打字游戲\2\Debug\2.pdb

?????文件??????33792??2009-07-19?06:36??打字游戲\2\Debug\vc60.idb

?????文件??????45056??2009-07-19?06:28??打字游戲\2\Debug\vc60.pdb

?????目錄??????????0??2009-07-20?13:20??打字游戲\1\Debug

?????目錄??????????0??2009-07-19?06:29??打字游戲\2\Debug

?????目錄??????????0??2009-07-20?13:35??打字游戲\1

?????目錄??????????0??2009-07-19?07:19??打字游戲\2

............此處省略4個文件信息

評論

共有 條評論