#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(" "); }
自己加入主题,时间。
祝你成功!不懂找我!
成立于2006年的荷兰Access2.IT Group B.V.(可查:VAT: NL853006404B01,CoC: 58365400) 一直运作着主机周边的业务,当前正在对荷兰的高性能AMD平台的VPS进行5折优惠,所有VPS直接砍一半。自有AS208258,vps母鸡配置为Supermicro 1024US-TRT 1U,2*AMD Epyc 7452(64核128线程),16条32G D...
Justg是一家俄罗斯VPS云服务器提供商,主要提供南非地区的VPS服务器产品,CN2高质量线路网络,100Mbps带宽,自带一个IPv4和8个IPv6,线路质量还不错,主要是用户较少,带宽使用率不高,比较空闲,不拥挤,比较适合面向非洲、欧美的用户业务需求,也适合追求速度快又需要冷门的朋友。justg的俄罗斯VPS云服务器位于莫斯科机房,到美国和中国速度都非常不错,到欧洲的平均延迟时间为40毫秒,...
7月份已经过去了一半,炎热的夏季已经来临了,主机圈也开始了大量的夏季促销攻势,近期收到一些商家投稿信息,提供欧美或者亚洲地区主机产品,价格优惠,这里做一个汇总,方便大家参考,排名不分先后,以邮件顺序,少部分因为促销具有一定的时效性,价格已经恢复故暂未列出。HostMem部落曾经分享过一次Hostmem的信息,这是一家提供动态云和经典云的国人VPS商家,其中动态云硬件按小时计费,流量按需使用;而经典...