初学者万年历c语言源代码,C语言万年历的源程序

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

for(j=1;j<=mon[i];j++)

{cprintf("%3d ",j);

/*if((first+j-1)%7==0)putchar('\n');*/

}

/*first=(first+mon[i])%7;

if(first==0)first=7;*/

}

}

void month5_8()

{for(i=0;i<2;i++)

{window(2+i*w,3,29+w*i,11);

textbackground(5);

clrscr();

textcolor(GREEN);

cprintf("            %s\n",month[i+4]);

gotoxy(1,2);cprintf(" Mon Tue Wed Thu Fri Sat Sun");

gotoxy(4*(fd[i+4]-1)+1,3);

for(j=1;j<=mon[i+4];j++)

{cprintf("%3d ",j);

/*if((first+j-1)%7==0)putchar('\n');*/

}

/*first=(first+mon[i+4])%7;

if(first==0)first=7;*/

}

for(i=2;i<4;i++)

{window(2+(i-2)*w,13,29+w*(i-2),21);

textbackground(5);

clrscr();

textcolor(GREEN);

cprintf("           %s",month[i+4]);

gotoxy(1,2);cprintf(" Mon Tue Wed Thu Fri Sat Sun");

gotoxy(4*(fd[i+4]-1)+1,3);

for(j=1;j<=mon[i+4];j++)

{cprintf("%3d ",j);

/*if((first+j-1)%7==0)putchar('\n');*/

}

/*first=(first+mon[i+4])%7;

if(first==0)first=7;*/

}

}

void month9_12()

{for(i=0;i<2;i++)

{window(2+i*w,3,29+w*i,11);

textbackground(5);

clrscr();

textcolor(GREEN);

cprintf("            %s\n",month[i+8]);

gotoxy(1,2);cprintf(" Mon Tue Wed Thu Fri Sat Sun");

gotoxy(4*(fd[i+8]-1)+1,3);

for(j=1;j<=mon[i+8];j++)

{cprintf("%3d ",j);

/*if((first+j-1)%7==0)putchar('\n');*/

}

/*first=(first+mon[i+8])%7;

if(first==0)first=7;*/

}

for(i=2;i<4;i++)

{window(2+(i-2)*w,13,29+w*(i-2),21);

textbackground(5);

clrscr();

textcolor(GREEN);

cprintf("            %s",month[i+8]);

gotoxy(1,2);cprintf(" Mon Tue Wed Thu Fri Sat Sun");

gotoxy(4*(fd[i+8]-1)+1,3);

for(j=1;j<=mon[i+8];j++)

{cprintf("%3d ",j);

/*if((first+j-1)%7==0)putchar('\n');*/

}

/*first=(first+mon[i+8])%7;

if(first==0)first=7;*/

}

}

void calendar(int year)

{int x,cha;

long day=0;

window(1,2,80,22);

textbackground(YELLOW);

clrscr();

if(year<2007)

{for(x=year;x<2007;x++)

{if((x%4==0&&x%100!=0)||x%400==0)

day+=366;

else day+=365;}

cha=day%7;

first=(7+1-cha)%7;

if(first==0)first=7;

}

if(year==2007)first=1;

if(year>2007)

{for(x=2007;x

{if((x%4==0&&x%100!=0)||x%400==0)

day+=366;

else day+=365;}

cha=day%7;

first=(1+cha)%7;

if(first==0)first=7;

}

if((year%4==0&&year%100!=0)||year%400==0)

mon[1]=29;

else mon[1]=28;

fd[0]=first;

for(j=1;j<12;j++)

{fd[j]=(fd[j-1]+mon[j-1])%7;

if(fd[j]==0)fd[j]=7;}

month1_4();}

void jiance2(int n)

{void nian(int year);

switch(n)

{case 0:getch( );quzhi();calendar(year);nian(year);break;

case 1:month1_4();break;

case 2:month5_8();break;

case 3:month9_12();break;

case 4:exit(0);break;

default:exit(0);}

}

void ping()

{clrscr();

window(1,1,80,1);

textbackground(RED);

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/278924.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

用imageMagick的composite合并图片

composite命令可以非常方便的合并两张图片 因此用来进行图像加水印、批量增加边框等常用的变换 最简单的用法为&#xff1a; composite -gravity north src.jpg coverback.jpg des.jpg 其中src.jpg为前景图片 coverback.jpg为背景图片。 des.jpg为叠加后的结果 -gravity north …

白帽子讲web安全——认证与会话管理

在看白帽子讲web安全&#xff0c;刚好看到认证与会话管理&#xff1a;也就是我们在平常渗透测试中遇到最多的登录页面&#xff0c;也即是用户名和密码认证方式&#xff0c;这是最常见的认证方式。 了解两个概念&#xff1a;认证和授权 1&#xff09;&#xff1a;认证的目的是为…

iphone充电图_哪些iPhone具有无线充电功能?

iphone充电图Kevin Parrish凯文帕里什Wireless charging means you can re-energize your phone’s battery without a physical tether. It also prevents possible damage to your phone’s charging port. Unfortunately, not all phones support wireless charging, but we…

关联分析算法c语言实现,机器学习关联分析

AI开发平台ModelArtsModelArts是面向开发者的一站式AI开发平台&#xff0c;为机器学习与深度学习提供海量数据预处理及半自动化标注、大规模分布式Training、自动化模型生成&#xff0c;及端-边-云模型按需部署能力&#xff0c;帮助用户快速创建和部署模型&#xff0c;管理全周…

windows平台下基于QT和OpenCV搭建图像处理平台

在之前的博客中&#xff0c;已经分别比较详细地阐述了“windows平台下基于VS和OpenCV”以及“Linux平台下基于QT和OpenCV"搭建图像处理框架&#xff0c;并且生成了相应的免费视频。这篇博客的主要内容&#xff0c;就是基于最新版本的相应工具&#xff0c;在windows平台下&…

android死锁解决方案,【线程死锁】Android多线程死锁产生的原因以及如何避免

一、死锁定义1、生活中的列子两人吃饭&#xff0c;但只有一双筷子&#xff0c;2人轮流吃(同时拥有2只筷子才能吃)&#xff0c;某个时候一人拿了左筷子&#xff0c;一人拿了右筷子&#xff0c;两人同时占用一个资源&#xff0c;等待另一个资源&#xff0c;这时候甲等乙吃完并释放…

前端开发 常用用的静态服务器

1 运用anywhere 安装 &#xff1a;npm install anywhere -g想要以某个路径作为静态文件服务器的根目录分享&#xff0c;只需要在该目录下执行&#xff1a;anywhere 就会默认8000打开网页&#xff0c; 若文件不是index.html 需要输入文件名 A: anywhere -p 8000 ## 指定静态服务…

前端面试题整理

1.HTML5的新特性。 主要讲讲新增哪些API:地理定位&#xff0c;拖放&#xff0c;web存储应用缓存&#xff0c;webworkers&#xff0c; sse 。 http://www.w3school.com.cn/html5/html_5_intro.asp 2.CSS3的新特性。 https://segmentfault.com/a/1190000010780991 3、使用严格模式…

android mvvm 官方例子,详解Android的MVVM框架 - 数据绑定

&#xfeff;本教程是跟着 Data Binding Guide学习过程中得出的一些实践经验&#xff0c;同时修改了官方教程的一些错误&#xff0c;每一个知识点都有对应的源码&#xff0c;争取做到实践与理论相结合。Data Binding 解决了 Android UI 编程中的一个痛点&#xff0c;官方原生支…

VS2015 代码左缩进

TabShift转载于:https://www.cnblogs.com/527289276qq/p/8027882.html

mac设置文件权限_如何在Mac上设置文件权限

mac设置文件权限Like all major operating systems, macOS allows you to restrict access to files using a complex set of file permissions. You can set these yourself using the Finder app, or by using the chmod command in your Mac’s terminal. Here’s how. 与所…

Discrete Log Algorithms :Baby-step giant-step

离散对数的求解 1.暴力 2.Baby-step giant-step 3.Pollard’s ρ algorithm …… 下面搬运一下Baby-step giant-step 的做法 这是在 https://ctf-wiki.github.io/ctf-wiki/crypto/asymmetric/discrete-log/discrete-log/ 上看到的&#xff0c;比较容易理解。 而且&#xff0c;…

Android添加item动画,RecyclerView基础篇-Item添加动画

Android_Banner.jpg简介本节中我们介绍下给RecyclerView中的Item添加动画。添加的动画&#xff0c;分为&#xff0c;在打开列表时有Item的展示动画&#xff0c;当滑动的时候没有动画和打开列表滑动时有动画两种实现过程实现一个列表效果如下Screenshot_2020-09-01-17-03-35-349…

Oracle数据库查询用 where in 查询的项超过1000条的解决方案

众所周知&#xff0c;如果我们的用SQL查询语句时&#xff0c;如果用where in带的参数超过1000条的话&#xff0c;oracle是会报错的。 因为项目中遇到这样的问题&#xff0c;所以找到了接下来我要说的这个办法。 因为用的地方很多&#xff0c;所以我把这个封装成了一个方法。 //…

geek_Ask How-To Geek:营救受感染的PC,安装无膨胀iTunes和驯服疯狂的触控板

geekYou’ve got questions and we’ve got answers. Today we highlight how to save your computer if it’s so overrun by viruses and malware you can’t work from within Windows, install iTunes without all the bloat, and tame a hyper-sensitive trackpad. 您有问…

第1课:接口测试和jmeter总结

接口测试 1. 接口的分类&#xff1a;webService和http api接口1&#xff09; webService接口&#xff1a;是按照soap协议通过http传输&#xff0c;请求报文和返回报文都是xml格式&#xff0c;一般要借助工具来测试接口&#xff1b;2&#xff09; http api接口&#xff1a;是按照…

android 工作日,如何在Android上重复警报工作日

小编典典请尝试此代码。已在我的应用中成功运行if (chk_monday.isChecked()) {forday(2);} else if (chk_tuesday.isChecked()) {forday(3);} else if (chk_wednesday.isChecked()) {forday(4);} else if (chk_thursday.isChecked()) {forday(5);} else if (chk_friday.isCheck…

hdu4419

对于这类面积覆盖的题&#xff0c;大致就两点要注意的 1.同一把矩形放在笛卡尔坐标系上做 2.pushup函数要注意下细节:及在统计子区间和之前要先判断是否有子区间 用sum数组来保存区间被覆盖的情况&#xff0c;如果遇到多次覆盖问题&#xff0c;那就开多个sum数组分别保存被覆盖…

最简单 - 单例模式

public class Person {// Person 引用private static Person p null;static {if (p null) {p new Person();}}/***单例模式获取Person对象. * return*/public static Person getInstance(){return p;} ​} 复制代码转载自&#xff1a; 简书 - 低至一折起 文章&#xff1a;w…

极客时间和极客学院_极客历史记录的本周:Twitter的诞生,OS X十周年以及太空停留时间最长的时代即将结束...

极客时间和极客学院Every week we bring you interesting trivia and milestones from the archives of Geekdom. Today we’re taking a peek at the birth of Twitter, ten years of Mac OS X, and the longest space stay in history. 每周&#xff0c;我们都会为您带来有趣…