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

建个商城网站需要多少钱湖北百度seo

建个商城网站需要多少钱,湖北百度seo,淄博微信网站建设,该怎么给做网站的提页面需求知识点 处理日期 1. 按天枚举日期:逐天遍历起始日期到结束日期范围内的每个日期。 2. 处理闰年:正确判断闰年条件。闰年定义为:年份 满足以下任意一个条件:(闰年的2月只有29天) 满足下面一个条件就是闰年 1> 是 400 的倍数…

知识点

处理日期

1. 按天枚举日期:逐天遍历起始日期到结束日期范围内的每个日期。

2. 处理闰年:正确判断闰年条件。闰年定义为:年份 满足以下任意一个条件:(闰年的2月只有29天)

满足下面一个条件就是闰年

1> 是 400 的倍数。

2> 是 4的倍数但不是 100的倍数

艺术与篮球

已知当前是星期几求出某个月的某一天是星期几

int week=x;x为第一天的日期

week = week%7+1求出每个星期的下一天

题目链接

1.艺术与篮球 - 蓝桥云课

题目解析

判断笔画数是不是超过50,超过50就去练习书法

算法原理

使用哈希表,把笔画和对应的数字联系在一起

使用日期函数来标记时间的开始和结尾,然后遍历每一天去计算笔画数

代码编写

import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;public class Main {public static void main(String[] args) {Map<Character, Integer> map = new HashMap<Character, Integer>() {{put('0', 13);  // 零put('1', 1);   // 一put('2', 2);   // 二put('3', 3);   // 三put('4', 5);   // 四put('5', 4);   // 五put('6', 4);   // 六put('7', 2);   // 七put('8', 2);   // 八put('9', 2);   // 九}};LocalDate startDate = LocalDate.of(2000, 1, 1);LocalDate endDate = LocalDate.of(2024, 4, 14);int days = 0;while (startDate.isBefore(endDate)) {String s = startDate.toString().replace("-", "");int total = 0;// 通过map查询笔画数for (char c : s.toCharArray()) {total += map.get(c);}if (total > 50) {days++;}startDate = startDate.plusDays(1);}System.out.println(days);}
}

从哪开始从哪结束

LocalDate startDate = LocalDate.of(2000, 1, 1);

LocalDate endDate = LocalDate.of(2024, 4, 14);

while 循环会一直执行,直到 startDate 等于或超过 endDate。循环会逐日增加 startDate,并计算当天日期的数字笔画数。

startDate.isBefore(endDate)

转为Srting类型,并且去除-

 startDate.toString().replace("-", "");

自增天数

  startDate = startDate.plusDays(1);

补充: 获得xxx年xxx月xx日是星期几

可以使用

LocalDate date = LocalDate.of(2026, 4, 1); // 获取星期几(英文)

String weekday = date.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH);

另一种写法

 //造一个hash表,里面对应笔画数int[] hash = {13, 1, 2, 3, 5, 4, 4, 2, 2, 2};//month里面放每月的个数int[] months = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};//计算打篮球的天数int count = 0;boolean feb = true;for (int year = 2000; year <= 2024; year++) {//笔画数int num = 0;//判断是平年还是润年//计算2月的值months[2] = isLeapYear(year) ? 29 : 28;//计算每一月,每一天for (int month = 1; month <= 12; month++) {for (int day = 1; day < months[month]; day++) {//计算年的每一位int ypos1 = year / 1000;year = year % 1000;int ypos2 = year / 100;year = year % 100;int ypos3 = year / 10;year = year % 10;int ypos4 = year;//计算月的每一位int mpos1 = month / 10;month = month % 10;int mpos2 = month;//计算每一天的每一位int dpos1 = day / 10;day = day % 10;int dpos2 = day;//计算笔画数num = hash[ypos1] + hash[ypos2] + hash[ypos3] + hash[ypos4] +hash[mpos1] + hash[mpos2] + hash[dpos1] + hash[dpos2];//最后计算天数if (num > 50) {count++;}if (year == 2024 && month == 4 && day == 13) {System.out.println(count);return;}}}}}public static void main(String[] args) {cal();}

http://www.dtcms.com/wzjs/498567.html

相关文章:

  • 北理工网站开发与运用常州免费网站建站模板
  • 什么软件可以发布做网站如何在百度发布信息
  • 公司网站域名注册费用黄山网站seo
  • 网站建设人力资源分配google seo怎么做
  • 网站限时抢购怎么做seo蜘蛛屯
  • 苏州网站制作排名优化seo优化平台
  • 网站开发的方法有哪些seo是什么职位缩写
  • 帮别人做网站开什么内容的专票互联网营销师培训
  • 服装官网网站建设b2b电子商务网站
  • 广州知名网站建设网页设计服务网络营销薪酬公司
  • 河南网站建设公司首页关键词排名优化
  • 小网站建设公司线上商城的推广方案
  • 中国移动网络优化做什么的天津seo优化公司
  • 西安招聘网最新招聘搜索引擎营销优化的方法
  • 网站建设 开发 模板百度知道个人中心
  • 阜阳建设委员会网站关键词优化到首页怎么做到的
  • 网站建设工程结算方式百度一下首页
  • 建站网站企业网站建设目标
  • 优秀产品设计北京seo顾问推推蛙
  • 苏州网站建设培训学校幽默广告软文案例
  • 淘宝店铺运营14个seo小技巧
  • 网站运营与管理的对策今日广州新闻最新消息
  • 固定ip如何做网站服务器沈阳今日新闻头条
  • 找公司建网站无锡网站seo
  • 不配置iis做网站湘潭关键词优化公司
  • 高端企业网站建设核心seo交流论坛
  • 重庆企业vi设计公司企业网站seo方案
  • 西宁做网站建设公司肇庆百度快照优化
  • 企业网站在ps里做吗关键词首页优化
  • 温州纪委作风建设网站优化网站收费标准