题目91 题目:时间函数举例1includecstdioincludectime涉及到时间函数的部分,这里给出资料。(主要我并没有深入了解这些东西intmain(){定义一个时间变量lttime(NULL);系统时间与日期printf(ctime());英文的时间格式printf(asctime(localtime()));printf(asctime(gmtime()));}asctime():https:www。runoob。comcprogrammingcfunctionasctime。htmlctime():https:www。runoob。comcprogrammingcfunctionctime。htmllocaltime():https:www。runoob。comcprogrammingcfunctionlocaltime。htmlgmtime():https:www。runoob。comcprogrammingcfunctiongmtime。html题目92 题目:时间函数举例2includecstdioincludectimedefineRregister计算程序运行时间,之前提到过的intmain(){这里与之前的不同,这里是通过本地时间计算的运行时间timetstarttime,starttimetime(NULL);for(Rinti1;i3000;i)printf(1111111111);1为转义字符endtimetime(NULL);printf(1:Thedifferentis6。3f,difftime(endtime,starttime));difftime返回的是结束时间与开始时间相差的秒数注意参数顺序是结束时间,开始时间}题目93 题目:时间函数举例3includecstdioincludectimedefineRregister同样是计算程序运行时间clock():https:www。runoob。comcprogrammingcfunctionclock。htmlintmain(){clocktstarttime,starttimeclock();for(Rinti1;i10000;i)printf(1111111111);endtimeclock();printf(1:Thedifferentis6。3lf,(double)(endtimestarttime)CLOCKSPERSEC);}题目94 题目:时间函数举例4(一个猜数游戏,判断一个人的反应快慢)。includecstdioincludectimeincludecstdlibdefineRintmain(){clocktstarttime,srand(time(NULL));printf(nowyouneedtoguessthisnumber);intansrand()100,cnt1;starttimeclock();scanf(d,x);while(x!ans){if(xans)printf(moresmallerplease);if(xans)printf(morebiggerplease);scanf(d,x);}endtimeclock();printf(Youonlyguesseddtimes!,cnt);printf(Andyouused6。3lfs,(double)(endtimestarttime)CLOCKSPERSEC);}题目95 题目:家庭财务管理小程序moneymanagementsystemincludecstdioincludedos。h这里的代码是网上流传的未解决的代码代码太抽象了,这里调整了一下排版,由于不清楚具体操作是做什么,又懒得分析,这个代码并没有完善,还是网络上的那个带有bug的代码如果有人想修复这个代码的话,可以喊上我一起(自己抽不出大把的时间进行完善分析intmain(){FILEfloatsum,chm0。0;intlen,i,j0;charch〔4〕,ch1〔16〕,chtime〔12〕,chshop〔16〕,chmoney〔8〕;pp:clrscr();sum0。0;gotoxy(1,1);printf();gotoxy(1,2);printf(moneymanagementsystem(C1。0)2000。03);gotoxy(1,3);printf();gotoxy(1,4);printf(moneyrecordstodaycostlist);gotoxy(1,5);printf();gotoxy(1,6);printf(date:);gotoxy(1,7);printf();gotoxy(1,8);printf();gotoxy(1,9);printf(thgs:);gotoxy(1,10);printf();gotoxy(1,11);printf();gotoxy(1,12);printf(cost:);gotoxy(1,13);printf();gotoxy(1,14);printf();gotoxy(1,15);printf();gotoxy(1,16);printf();gotoxy(1,17);printf();gotoxy(1,18);printf();gotoxy(1,19);printf();gotoxy(1,20);printf();gotoxy(1,21);printf();gotoxy(1,22);printf();gotoxy(1,23);printf();i0;getdate(d);sprintf(chtime,4d。02d。02d,d。dayear,d。damon,d。daday);52for(;;){gotoxy(3,24);printf(TabbrowsecostlistEscquit);gotoxy(13,10);printf();gotoxy(13,13);printf();gotoxy(13,7);printf(s,chtime);j18;ch〔0〕getch();if(ch〔0〕27)strcpy(chshop,);strcpy(chmoney,);if(ch〔0〕9){mm:i0;fpfopen(home。dat,r);gotoxy(3,24);printf();gotoxy(6,4);printf(listrecords);gotoxy(1,5);printf();gotoxy(41,4);printf();gotoxy(41,5);printf();while(fscanf(fp,10s14sf,chtime,chshop,chm)!EOF){if(i36){getch();i0;}if((i36)17){gotoxy(4,6i);printf();gotoxy(4,6i);}elseif((i36)16){gotoxy(41,4i17);printf();gotoxy(42,4i17);}i;printf(10s14s6。1f,chtime,chshop,chm);}gotoxy(1,23);printf();gotoxy(1,24);printf();gotoxy(1,25);printf();gotoxy(10,24);printf(totalis8。1f34;,sum);fclose(fp);gotoxy(49,24);printf(pressanykeyto。。。。。);getch();}else{while(ch〔0〕!r){if(j10){strncat(chtime,ch,1);j;}if(ch〔0〕8){lenstrlen(chtime)1;if(j15){lenlen1;j11;}strcpy(ch1,);jj2;strncat(ch1,chtime,len);strcpy(chtime,);strncat(chtime,ch1,len1);gotoxy(13,7);printf();}gotoxy(13,7);printf(s,chtime);ch〔0〕getch();if(ch〔0〕9)if(ch〔0〕27)exit(1);}gotoxy(3,24);printf();gotoxy(13,10);j0;ch〔0〕getch();while(ch〔0〕!r){if(j14){strncat(chshop,ch,1);j;}if(ch〔0〕8){lenstrlen(chshop)1;strcpy(ch1,);jj2;strncat(ch1,chshop,len);strcpy(chshop,);strncat(chshop,ch1,len1);gotoxy(13,10);printf();}gotoxy(13,10);printf(s,chshop);ch〔0〕getch();}gotoxy(13,13);j0;ch〔0〕getch();while(ch〔0〕!r){if(j6){strncat(chmoney,ch,1);j;}if(ch〔0〕8){lenstrlen(chmoney)1;strcpy(ch1,);jj2;strncat(ch1,chmoney,len);strcpy(chmoney,);strncat(chmoney,ch1,len1);gotoxy(13,13);printf();}gotoxy(13,13);printf(s,chmoney);ch〔0〕getch();}if((strlen(chshop)0)(strlen(chmoney)0))这下面的if不知道应该配上哪一个,未作改动if((fpfopen(home。dat,a))!NULL);fprintf(fp,10s14s6s,chtime,chshop,chmoney);fputc(,fp);fclose(fp);i;gotoxy(41,5i);printf(10s14s6s,chtime,chshop,chmoney);}}}