#include<stdio.h> #include<time.h> int leap (int year)//判断闰年 { if(year%4==0&&year%100!=0||year%400==0) return 1; else return 0; } int days_month (int month,int year)//判断月 { if(month==1||month==3||month==5||month==7||month==8||month==10||month==12) return 31; if(month==4||month==6||month==9||month==11) return 30; if(month==2&&leap(year)==1) return 29; else return 28; } int firstday(int month,int year)//判断年 { int w; w=(1+2*month+3*(month+1)/5+year+year/4+year/400-year/100)%7+1; return w; } main() { //调用系统时间 time_al; struct tm *now; al = time(NULL); now = localtime(&al); printf("现在时间: %4d年 %d月 %02d日 %d:%02d:%02d ", now->tm_year+1900, now->tm_mon+1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec); //调用结束 int i,j=1,k=1,a,b,month,year; b=days_month(now->tm_mon+1,now->tm_year+1900); a=firstday (now->tm_mon+1,now->tm_year+1900); printf(" Sun Mon Tue Wed Thu Fri Sat "); if(a==7) { for(i=1;i<=b;i++) { printf("%4d",i); if(i%7==0) { printf(" "); } } } if(a!=7) { while (j<=4*a) { printf(" "); j++; } for(i=1;i<=b;i++) { printf("%4d",i); if(i==7*k-a) { printf(" "); k++; } } } printf(" "); }
自己加入主题,时间。
祝你成功!不懂找我!
digital-vm在日本东京机房当前提供1Gbps带宽、2Gbps带宽、10Gbps带宽接入的独立服务器,每个月自带10T免费流量,一个独立IPv4。支持额外购买流量:20T-$30/月、50T-$150/月、100T-$270美元/月;也支持额外购买IPv4,/29-$5/月、/28-$13/月。独立从下单开始一般24小时内可以上架。官方网站:https://digital-vm.com/de...
PQ.hosting怎么样?PQ.hosting是一家俄罗斯商家,正规公司,主要提供KVM VPS和独立服务器,VPS数据中心有香港HE、俄罗斯莫斯科DataPro、乌克兰VOLIA、拉脱维亚、荷兰Serverius、摩尔多瓦Alexhost、德国等。部分配置有变化,同时开通Paypal付款。香港、乌克兰、德国、斯洛伐克、捷克等为NVMe硬盘。香港为HE线路,三网绕美(不太建议香港)。免费支持wi...
便宜的香港vps多少钱?现在国外VPS主机的价格已经很便宜了,美国VPS主机最低一个月只要十几元,但同样免备案的香港VPS价格贵不贵呢?或者说便宜的香港VPS多少钱?香港vps主机价格要比美国机房的贵一些,但比国内的又便宜不少,所以目前情况是同等配置下,美国VPS比香港的便宜,香港VPS比国内(指大陆地区)的便宜。目前,最便宜香港vps低至3元/首月、18元/月起,今天云服务器网(www.yunt...