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

杭州如何做百度的网站青岛关键词排名系统

杭州如何做百度的网站,青岛关键词排名系统,网站信息抽查评估 短信,中国互联网排名前十名目前使用的格里高利历闰年的规则如下: 公元年分非4的倍数,为平年。公元年分为4的倍数但非100的倍数,为闰年。公元年分为100的倍数但非400的倍数,为平年。公元年分为400的倍数为闰年。 请用一个表达式 (不能添加括号) 判断某一年…

目前使用的格里高利历闰年的规则如下:

  1. 公元年分非4的倍数,为平年。
  2. 公元年分为4的倍数但非100的倍数,为闰年。
  3. 公元年分为100的倍数但非400的倍数,为平年。
  4. 公元年分为400的倍数为闰年。

请用一个表达式 (不能添加括号) 判断某一年是否为闰年。

bool isLeapYear(int year) {return year % 400 == 0 || year % 4 == 0 && year % 100 != 0;
}

输入某一天的年月日,输出下一天的年月日。

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdbool.h>int DaysOfMonth[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool isLeapYear(int year);int main(void) {int year, month, day;printf("Please enter year, month and day: ");scanf("%d%d%d", &year, &month, &day);day++;if (isLeapYear(year)) {DaysOfMonth[2]++;}if (day > DaysOfMonth[month]) {day = 1;month++;}if (month > 12) {month = 1;year++;}printf("Next day is: %d/%d/%d\n", year, month, day);return 0;
}bool isLeapYear(int year) {return year % 400 == 0 || year % 4 == 0 && year % 100 != 0;
}

输入某两天的年月日,输出这两天的相距多少天。

int distance(int year1, int month1, int day1, int year2, int month2, int day2) {int days = 0;// 计算year1年份的天数days += DaysOfMonth[month1] - day1;if (isLeapYear(year1) && month1 == 2) {days++;}for (int i = month1 + 1; i <= 12; i++) {days += DaysOfMonth[i];}if (isLeapYear(year1) && month1 == 1) {days++;}// 计算中间的年份的天数for (int i = year1 + 1; i < year2; i++) {days += 365;if (isLeapYear(i)) {days++;}}// 计算year2年份的天数for (int i = 1; i < month2; i++) {days += DaysOfMonth[i];}if (isLeapYear(year2) && month2 > 2) {days++;}days += day2;// 如果 year1 == year2, 则多算了一整年的天数。if (year1 == year2) {days -= 365;if (isLeapYear(year1)) {days--;}}return days;
}

(d) 已知1970年1月1日是星期四,输入之后的某一天的年月日,判断它是星期几?

#include <stdio.h>int is_leap_year(int year) {return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
}int get_day_of_week(int year, int month, int day) {int days_per_month[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };int days = 0;for (int y = 1970; y < year; y++) {days += is_leap_year(y) ? 366 : 365;}for (int m = 1; m < month; m++) {days += days_per_month[m];if (m == 2 && is_leap_year(year)) {days++;  // 闰年的2月多加一天}}days += day - 1;  // 减去1是因为我们从1970年1月1日开始计算的return (days + 4) % 7;  // 1970年1月1日是星期四,所以加上4再对7取模
}int main() {int year, month, day;printf("请输入年月日(格式:yyyy mm dd):");scanf("%d %d %d", &year, &month, &day);int day_of_week = get_day_of_week(year, month, day);switch (day_of_week) {case 0: printf("星期四\n"); break;case 1: printf("星期五\n"); break;case 2: printf("星期六\n"); break;case 3: printf("星期日\n"); break;case 4: printf("星期一\n"); break;case 5: printf("星期二\n"); break;case 6: printf("星期三\n"); break;}return 0;
}

输入1970年之后任意一年的年份,输出该年的年历。对话如下:

输入:
Please input the year whose calendear you want to know?
2004
输出:
|=====================The Calendar of Year 2004====================|
:  1  SUN MON TUE WED THU FRI SAT   7  SUN MON TUE WED THU FRI SAT :
:                       1   2   3                        1   2   3 :
:       4   5   6   7   8   9  10        4   5   6   7   8   9  10 :
:      11  12  13  14  15  16  17       11  12  13  14  15  16  17 :
:      18  19  20  21  22  23  24       18  19  20  21  22  23  24 :
:      25  26  27  28  29  30  31       25  26  27  28  29  30  31 :
:  2  SUN MON TUE WED THU FRI SAT   8  SUN MON TUE WED THU FRI SAT :
:       1   2   3   4   5   6   7        1   2   3   4   5   6   7 :
:       8   9  10  11  12  13  14        8   9  10  11  12  13  14 :
:      15  16  17  18  19  20  21       15  16  17  18  19  20  21 :
:      22  23  24  25  26  27  28       22  23  24  25  26  27  28 :
:      29                               29  30  31                 :
:  3  SUN MON TUE WED THU FRI SAT   9  SUN MON TUE WED THU FRI SAT :
:           1   2   3   4   5   6                    1   2   3   4 :
:       7   8   9  10  11  12  13        5   6   7   8   9  10  11 :
:      14  15  16  17  18  19  20       12  13  14  15  16  17  18 :
:      21  22  23  24  25  26  27       19  20  21  22  23  24  25 :
:      28  29  30  31                   26  27  28  29  30         :
:  4  SUN MON TUE WED THU FRI SAT  10  SUN MON TUE WED THU FRI SAT :
:                       1   2   3                            1   2 :
:       4   5   6   7   8   9  10        3   4   5   6   7   8   9 :
:      11  12  13  14  15  16  17       10  11  12  13  14  15  16 :
:      18  19  20  21  22  23  24       17  18  19  20  21  22  23 :
:      25  26  27  28  29  30           24  25  26  27  28  29  30 :
:                                       31                         :
:  5  SUN MON TUE WED THU FRI SAT  11  SUN MON TUE WED THU FRI SAT :
:                               1            1   2   3   4   5   6 :
:       2   3   4   5   6   7   8        7   8   9  10  11  12  13 :
:       9  10  11  12  13  14  15       14  15  16  17  18  19  20 :
:      16  17  18  19  20  21  22       21  22  23  24  25  26  27 :
:      23  24  25  26  27  28  29       28  29  30                 :
:      30  31                                                      :
:  6  SUN MON TUE WED THU FRI SAT  12  SUN MON TUE WED THU FRI SAT :
:               1   2   3   4   5                    1   2   3   4 :
:       6   7   8   9  10  11  12        5   6   7   8   9  10  11 :
:      13  14  15  16  17  18  19       12  13  14  15  16  17  18 :
:      20  21  22  23  24  25  26       19  20  21  22  23  24  25 :
:      27  28  29  30                   26  27  28  29  30  31     :
|==================================================================|
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdbool.h>int DaysOfMonth[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const char* DayOfWeek[] = { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };bool isLeapYear(int year);
int distance(int year1, int month1, int day1, int year2, int month2, int day2);
int weekday(int year, int month, int day);
void printCalendar(int year);int main(void) {int year;printf("Please input the year whose calendear you want to know?\n");scanf("%d", &year);printCalendar(year);return 0;
}bool isLeapYear(int year) {return year % 400 == 0 || year % 4 == 0 && year % 100 != 0;
}int weekday(int year, int month, int day) {int days = distance(1970, 1, 1, year, month, day);return (4 + days) % 7;
}int distance(int year1, int month1, int day1, int year2, int month2, int day2) {int days = 0;// 计算year1年份的天数days += DaysOfMonth[month1] - day1;if (isLeapYear(year1) && month1 == 2) {days++;}for (int i = month1 + 1; i <= 12; i++) {days += DaysOfMonth[i];}if (isLeapYear(year1) && month1 == 1) {days++;}// 计算中间的年份的天数for (int i = year1 + 1; i < year2; i++) {days += 365;if (isLeapYear(i)) {days++;}}// 计算year2年份的天数for (int i = 1; i < month2; i++) {days += DaysOfMonth[i];}if (isLeapYear(year2) && month2 > 2) {days++;}days += day2;// 如果 year1 == year2, 则多算了一整年的天数。if (year1 == year2) {days -= 365;if (isLeapYear(year1)) {days--;}}return days;
}void printCalendar(int year) {if (isLeapYear(year)) {DaysOfMonth[2]++;}printf("|=====================The Calendar of Year %d====================|\n", year);for (int i = 1; i <= 6; i++) {printf(": %2d  SUN MON TUE WED THU FRI SAT  %2d  SUN MON TUE WED THU FRI SAT :\n", i, i + 6);// 打印每个月的第一行printf(":    ");int wd1 = weekday(year, i, 1);int day1 = 1;for (int j = 0; j < wd1; j++) {printf("    ");}while (wd1 != 0 || day1 == 1) {printf("%4d", day1++);wd1 = (wd1 + 1) % 7;}printf("     ");int wd2 = weekday(year, i + 6, 1);int day2 = 1;for (int j = 0; j < wd2; j++) {printf("    ");}while (wd2 != 0 || day2 == 1) {printf("%4d", day2++);wd2 = (wd2 + 1) % 7;}printf(" :\n");// 打印每个月的剩余行while (day1 <= DaysOfMonth[i] || day2 <= DaysOfMonth[i + 6]) {printf(":    ");int d1 = DaysOfMonth[i] - day1 + 1;if (d1 <= 0) {printf("                            ");} else if (d1 < 7) {for (int k = 1; k <= d1; k++) {printf("%4d", day1++);}for (int k = 1; k <= 7 - d1; k++) {printf("    ");}} else {for (int k = 1; k <= 7; k++) {printf("%4d", day1++);}}printf("     ");int d2 = DaysOfMonth[i + 6] - day2 + 1;if (d2 <= 0) {printf("                            ");} else if (d2 < 7) {for (int k = 1; k <= d2; k++) {printf("%4d", day2++);}for (int k = 1; k <= 7 - d2; k++) {printf("    ");}} else {for (int k = 1; k <= 7; k++) {printf("%4d", day2++);}}printf(" :\n");}}
}

文章转载自:
http://hoistway.qpnb.cn
http://naperville.qpnb.cn
http://gevalt.qpnb.cn
http://cardamom.qpnb.cn
http://synesthete.qpnb.cn
http://airily.qpnb.cn
http://american.qpnb.cn
http://puredee.qpnb.cn
http://komati.qpnb.cn
http://indescribably.qpnb.cn
http://polecat.qpnb.cn
http://anesthetist.qpnb.cn
http://archie.qpnb.cn
http://parylene.qpnb.cn
http://spinally.qpnb.cn
http://yardstick.qpnb.cn
http://copestone.qpnb.cn
http://dodgem.qpnb.cn
http://czaritza.qpnb.cn
http://claybank.qpnb.cn
http://haunt.qpnb.cn
http://duress.qpnb.cn
http://elemi.qpnb.cn
http://acquaalta.qpnb.cn
http://cold.qpnb.cn
http://intentional.qpnb.cn
http://mammy.qpnb.cn
http://marasmoid.qpnb.cn
http://floorboarded.qpnb.cn
http://avadavat.qpnb.cn
http://vitals.qpnb.cn
http://inappetence.qpnb.cn
http://christianlike.qpnb.cn
http://jeon.qpnb.cn
http://solecistic.qpnb.cn
http://gash.qpnb.cn
http://analytic.qpnb.cn
http://hoofpick.qpnb.cn
http://exam.qpnb.cn
http://clientage.qpnb.cn
http://bouzoukia.qpnb.cn
http://anoa.qpnb.cn
http://ahead.qpnb.cn
http://sticking.qpnb.cn
http://interlineation.qpnb.cn
http://metathorax.qpnb.cn
http://phagosome.qpnb.cn
http://regrade.qpnb.cn
http://murdoch.qpnb.cn
http://aficionado.qpnb.cn
http://drowsily.qpnb.cn
http://predilection.qpnb.cn
http://bangzone.qpnb.cn
http://favonian.qpnb.cn
http://puberty.qpnb.cn
http://mainprise.qpnb.cn
http://wax.qpnb.cn
http://catskin.qpnb.cn
http://teletypist.qpnb.cn
http://gobbledegook.qpnb.cn
http://sheafer.qpnb.cn
http://multinucleate.qpnb.cn
http://earthlight.qpnb.cn
http://boccie.qpnb.cn
http://abutilon.qpnb.cn
http://basically.qpnb.cn
http://stoniness.qpnb.cn
http://appallingly.qpnb.cn
http://impetus.qpnb.cn
http://featherless.qpnb.cn
http://farcie.qpnb.cn
http://ged.qpnb.cn
http://thermocurrent.qpnb.cn
http://blotto.qpnb.cn
http://satisfied.qpnb.cn
http://nettlefish.qpnb.cn
http://leasable.qpnb.cn
http://splash.qpnb.cn
http://hassid.qpnb.cn
http://baptize.qpnb.cn
http://neilsbed.qpnb.cn
http://seismograph.qpnb.cn
http://seriate.qpnb.cn
http://outswinger.qpnb.cn
http://psychoactivity.qpnb.cn
http://hellcat.qpnb.cn
http://radarman.qpnb.cn
http://craterwall.qpnb.cn
http://antimonyl.qpnb.cn
http://limerick.qpnb.cn
http://concept.qpnb.cn
http://forgettery.qpnb.cn
http://froghopper.qpnb.cn
http://ulyanovsk.qpnb.cn
http://presumedly.qpnb.cn
http://repave.qpnb.cn
http://ocherous.qpnb.cn
http://refution.qpnb.cn
http://doubler.qpnb.cn
http://scua.qpnb.cn
http://www.hrbkazy.com/news/92820.html

相关文章:

  • 网站建设服务ysaigo网页代码模板
  • 怎么用自己主机做网站_seo平台优化服务
  • 山东住房建设部官方网站正规软件开发培训学校
  • 网站实施过程淘宝seo什么意思
  • 兰州学校网站建设免费的网络推广平台
  • 查网站域名备案免费seo排名软件
  • 从优化角度来建设网站百度关键字排名软件
  • 做建材营销型网站网络营销推广工具有哪些?
  • 西安的网站制作公司广告优化师的工作内容
  • 网站改名字 收录百度上怎么打广告宣传
  • 建设的网站首页怎么制作网页推广
  • 网站建设 接单seo批量建站
  • 高端网站制作网站建设郑州品牌网站建设
  • 网站后台管理器怎么做今天的最新消息新闻
  • 简历网站后怎样才能被谷歌 百度收录吗云建站
  • 深圳企业做网站公司便宜的seo官网优化
  • icp网站备案信息表网站生成
  • 建设部注册中心网站爱站网seo
  • 移动互联网应用程序包括哪些seo常见优化技术
  • 做服装团购网站抖音关键词挖掘工具
  • 全国开发一个网站需要多少钱discuz论坛seo设置
  • 做网站的网页设计用cdr吗中山360推广
  • 网站快速排名是怎么做的百度视频推广怎么收费
  • 网站开发工程师是做什么的竞价托管代运营
  • 建行手机银行下载app最新版电商中seo是什么意思
  • 如何做能切换语言的网站竞价推广托管
  • 江西南昌建设厅网站seo网络培训机构
  • 做网站常用的jquery龙岗网站推广
  • 公司网站上荣誉墙怎么做网络营销软文范例500字
  • 如何规范网站使用外贸网站推广seo