#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(" "); }
自己加入主题,时间。
祝你成功!不懂找我!
近日Friendhosting发布了最新的消息,新上线了美国迈阿密的云产品,之前的夏季优惠活动还在进行中,全场一次性45折优惠,最高可购买半年,超过半年优惠力度就不高了,Friendhosting商家的优势就是100Mbps带宽不限流量,有需要的朋友可以尝试一下。Friendhosting怎么样?Friendhosting服务器好不好?Friendhosting服务器值不值得购买?Friendho...
这个月11号ShockHosting发了个新上日本东京机房的邮件,并且表示其他机房可以申请转移到日本,刚好赵容手里有个美国的也没数据就发工单申请新开了一个,这里做个简单的测试,方便大家参考。ShockHosting成立于2013年,目前提供的VPS主机可以选择11个数据中心,包括美国洛杉矶、芝加哥、达拉斯、杰克逊维尔、新泽西、澳大利亚、新加坡、日本、荷兰和英国等。官方网站:https://shoc...
对于DMIT商家已经关注有一些时候,看到不少的隔壁朋友们都有分享到,但是这篇还是我第一次分享这个服务商。根据看介绍,DMIT是一家成立于2017年的美国商家,据说是由几位留美学生创立的,数据中心位于香港、伯力G-Core和洛杉矶,主打香港CN2直连云服务器、美国CN2直连云服务器产品。最近看到DMIT商家有对洛杉矶CN2 GIA VPS端口进行了升级,不过价格没有变化,依然是季付28.88美元起。...