69,371
社区成员
发帖
与我相关
我的任务
分享
#include <windows.h>
#include <stdio.h>
#include <share.h>
fp = _fsopen(filename,"w",_SH_DENYWR);
//写到文本,每行按这个格式
fprintf(fp,"%x,%x,%x,%x,%x,%x,%x,%x\n",x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x);
fflush(fp);
Sleep(5000);
//这里是一大堆必不可少的东西
}
fclose(fp);
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main(int argc, char *argv[])
{
while(1){
printf("1,");
fflush(NULL);
Sleep(3000);
}
return 0;
}
#include<stdio.h>
#include<time.h>
main()
{
clock_t goal,wait;
wait=(clock_t)5*CLK_TCK;
goal=wait+clock();
while(goal>clock());
printf("\nThe programme has delay 5 seconds!\n");
}
#include <stdio.h>
#include<time.h>
main()
{
time_t start_time,end_time;
time(&start_time);
do
{
time(&end_time);
}while(difftime(end_time,start_time)<5.00);
printf("\The programme has delay 5 seconds!");
}