版本比较
时钟
正文
增加 8 行删除 8 行
1233456777 行未改动858687888989909192939495969697989910070 行未改动171172173174175176177178175176177178179180181182183184185186187188188189```cpp#include<cstdio>#include<ctime> #include<ctime>#include<cstdlib>#include<windows.h>#include<conio.h>using namespace std;77 行未改动 tim[5]=p->tm_sec; xq[0]=wday[p->tm_wday][0]; xq[1]=wday[p->tm_wday][1]; xq[2]=wday[p->tm_wday][2];} }void good(){ HideCursor(); printf("good "); if(tim[3]>5&&tim[3]<12) printf("morning"); else if(tim[3]<6||tim[3]>18) printf("evening"); else printf("afternoon"); printf("\n"); printf("\n");}void shu(int t1,int t2,int t3){ for(int i=1;i<6;i++){ if(t1/10==0) printf("%s ",zero[i]);70 行未改动 get(); printf("%d/%d/%d %s\n",tim[0],tim[1],tim[2],xq); shu(tim[3],tim[4],tim[5]); Sleep(200); } } int main() { }}int main(){ char e; get(); good(); printf("Welcome to use this clock\n"); printf("Please press any key to continue...\n"); e=getch(); system("cls"); HideCursor(); zb(); return 0; return 0;}