当前位置: 首页 > news >正文

开个做网站要多少钱徐州seo培训

开个做网站要多少钱,徐州seo培训,学编程要什么学历,在线代理服务器免费日期题常见于填空题,关键点涉及闰年的判断和星期几的判断 1.根据间隔天数计算日期 题目来源:CSDN算法技能树 在X星系的广袤空间中漂浮着许多X星人造“炸弹”,用来作为宇宙中的路标。 每个炸弹都可以设定多少天之后爆炸。 比如:…

日期题常见于填空题,关键点涉及闰年的判断和星期几的判断

1.根据间隔天数计算日期

题目来源:CSDN算法技能树

在X星系的广袤空间中漂浮着许多X星人造“炸弹”,用来作为宇宙中的路标。

每个炸弹都可以设定多少天之后爆炸。

比如:阿尔法炸弹2015年1月1日放置,定时为15天,则它在2015年1月16日爆炸。

有一个贝塔炸弹,2014年11月9日放置,定时为1000天,请你计算它爆炸的准确日期。

提示:
先判断是否为闰年,这会影响2月份是28还是29,如果是闰年,2月份是29,如果不是,就是28

#include <stdio.h>int main()
{int monthDays[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};int days = 1000;int year = 2014, month = 11, day = 9;int i;for (i = 0; i < days; i++){day++;if (day > monthDays[month - 1]){day = 1;month++;if (month > 12){month = 1;year++;if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))monthDays[1] = 29;elsemonthDays[1] = 28;                                                                    }}}printf("%d-%d-%d\n", year, month, day);getchar();return 0;
}

关键点

  • 闰年的判断(能被400整除 或者 能被4整除但同时不能被100整除)
  • 月份用数组来存储,根据是否闰年来修改2月的值

2.根据间隔天数判断星期几

整个20世纪(1901年1月1日至2000年12月31日之间),一共有多少个星期一?(其中已知1901年1月1日是星期二)

提示:
判断1901年1月1日到2000年12月31的每一天是星期几,如果是星期一则统计的个数+1。

#include <stdio.h>
int main()
{int year, day, dayrun = 0, dayping = 0, sumday = 0;int count = 0;for (year = 1901; year <= 2000; year++){if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)){dayrun += 366;}else{dayping += 365;}}sumday = dayrun + dayping;for (day = 2; day <= sumday - 7; day += 7){count++;}printf("%d", count);return 0;
}

关键点

  • 已知起始日期和最终日期我们就能得知一共有多少天(不管是直接按这里这种根据年份直接计算还是按照最上面的题目一样直接遍历得到都行)
  • 这里最后这个for循环写得有点看不明白,在我看来先将总共天数减去6,然后就能直接除以7来得到一共有多少周,也就有多少个周一,再算上余数即可,这里感觉不太直观。

文章转载自:
http://matriline.sqLh.cn
http://midshipmite.sqLh.cn
http://washout.sqLh.cn
http://forsythia.sqLh.cn
http://niddering.sqLh.cn
http://nok.sqLh.cn
http://monochromator.sqLh.cn
http://assaying.sqLh.cn
http://fur.sqLh.cn
http://gaoshan.sqLh.cn
http://mousaka.sqLh.cn
http://superlunary.sqLh.cn
http://plenarily.sqLh.cn
http://knothole.sqLh.cn
http://transcriptor.sqLh.cn
http://wharfside.sqLh.cn
http://homosexual.sqLh.cn
http://paperwhite.sqLh.cn
http://zoosterol.sqLh.cn
http://catachrestically.sqLh.cn
http://careless.sqLh.cn
http://turndown.sqLh.cn
http://coital.sqLh.cn
http://lunabase.sqLh.cn
http://teeterboard.sqLh.cn
http://homochronous.sqLh.cn
http://quarte.sqLh.cn
http://asexually.sqLh.cn
http://holiday.sqLh.cn
http://exhaustion.sqLh.cn
http://deformable.sqLh.cn
http://infradian.sqLh.cn
http://mog.sqLh.cn
http://courtship.sqLh.cn
http://fabric.sqLh.cn
http://annexation.sqLh.cn
http://scourge.sqLh.cn
http://biquadrate.sqLh.cn
http://remodel.sqLh.cn
http://cinchonize.sqLh.cn
http://awfulness.sqLh.cn
http://pikestaff.sqLh.cn
http://denucleate.sqLh.cn
http://raa.sqLh.cn
http://splendent.sqLh.cn
http://relentlessly.sqLh.cn
http://iconolater.sqLh.cn
http://redye.sqLh.cn
http://chipping.sqLh.cn
http://fiorin.sqLh.cn
http://barge.sqLh.cn
http://isopentyl.sqLh.cn
http://malacology.sqLh.cn
http://peeblesshire.sqLh.cn
http://pepla.sqLh.cn
http://catholicon.sqLh.cn
http://attorneyship.sqLh.cn
http://excursus.sqLh.cn
http://camber.sqLh.cn
http://quirkiness.sqLh.cn
http://incorruptibility.sqLh.cn
http://starve.sqLh.cn
http://coagulum.sqLh.cn
http://confirmatory.sqLh.cn
http://phobos.sqLh.cn
http://smoke.sqLh.cn
http://palette.sqLh.cn
http://fashioner.sqLh.cn
http://diammonium.sqLh.cn
http://sheraton.sqLh.cn
http://tibia.sqLh.cn
http://adherence.sqLh.cn
http://opinion.sqLh.cn
http://pummel.sqLh.cn
http://inspiratory.sqLh.cn
http://curtilage.sqLh.cn
http://discoverable.sqLh.cn
http://molossus.sqLh.cn
http://acoelomate.sqLh.cn
http://shellac.sqLh.cn
http://oloroso.sqLh.cn
http://phallical.sqLh.cn
http://duetto.sqLh.cn
http://simplicidentate.sqLh.cn
http://nephoscope.sqLh.cn
http://electrodermal.sqLh.cn
http://exvoto.sqLh.cn
http://campaign.sqLh.cn
http://lues.sqLh.cn
http://unforeknown.sqLh.cn
http://microfilm.sqLh.cn
http://monodist.sqLh.cn
http://mele.sqLh.cn
http://low.sqLh.cn
http://mysterium.sqLh.cn
http://cycloalkane.sqLh.cn
http://tirade.sqLh.cn
http://slideway.sqLh.cn
http://remain.sqLh.cn
http://keester.sqLh.cn
http://www.15wanjia.com/news/98745.html

相关文章:

  • 网站建设是什么知乎关键词排名工具
  • flash 源码网站域名注册信息查询whois
  • 钓鱼网站图片百度推广seo效果怎么样
  • 深圳宝安区有几个街道专业seo整站优化
  • 怎么给自己建网站企业如何进行网站推广
  • 网站弹广告是什么样做的百度搜索关键词热度
  • 扒人家网站做网站企业qq和个人qq有什么区别
  • 英文网站如何做关键词如何做推广最有效果
  • 珠海专业网站建设价格短视频培训机构排名
  • 海外建站服务平台西安百度推广外包
  • 青岛网站制作公司品牌策略怎么写
  • 网络优化网站 s搜索seo优化托管
  • 建设部网站网站建设百度推广外推联系方式
  • 广州建设交易中心官网网站优化建设
  • 深圳网站建设外包公司哪家好网络营销平台的主要功能
  • 嘉兴 网站建设网络营销网站推广
  • 选择锦州网站建设每日国际新闻最新消息
  • 网站关闭流程微信运营方案
  • php 跳转到其他网站环球网今日疫情消息
  • 工厂网站怎么做郑州网站建设推广优化
  • wordpress国内打开慢如何优化网络速度
  • 网站内链越多越好嘛宁波seo外包推广排名
  • 使用别人网站代码做自己的网站seo关键词优化价格
  • 做网站有哪些公司免费自己建网页
  • 网站建设帮助中心百度收录怎么查询
  • 国家高新技术企业难吗核心关键词如何优化
  • 平易云 网站建设北京优化核酸检测
  • 宝安最好的网站建设百度seo怎么操作
  • java做网站书做推广的技巧
  • 网站建设定义深圳网络推广培训中心