当前位置:网站首页>蓝桥杯原题
蓝桥杯原题
2022-07-28 02:06:00 【旧梦拾遗186】
目录
题目一:
第一题:时间显示
答案:
#include<stdio.h> int main() { long long int n = 0; scanf("%lld", &n); long long int time = 0; time = n % (24 * 60 * 60 * 1000); int HH = time /( 60 * 1000 * 60); time = time % (60 * 1000 * 60); int MM = time / (60 * 1000); time = time % (60 * 1000); int SS = time / 1000; printf("%02d:%02d:%02d", HH, MM, SS); return 0; }
第二题:
试题A:九进制转十进制
本题总分:5分
【问题描述】
九进制正整数( 2022 ) 9 (2022)_9(2022)
9
转换成十进制等于多少?
(2022)9=2∗93+2∗91+2∗90=1478
第三题:
试题B:顺子日期
本题总分:5分
【问题描述】
小明特别喜欢顺子。顺子指的就是连续的三个数字:123、456等。顺子日期指的就是在日期的yyyymmdd表示法中,存在任意连续的三位数是一个顺子的日期。例如20220123就是一个顺子日期,因为它出现了一个顺子:123;而20221023则不是一个顺子日期,它一个顺子也没有。小明想知道在整个2022年份中,一共有多少个顺子日期。
解析:
此题考查的是推理能力。由于年份已经确定,因此只需判断2022mmdd是否包含顺子。
mm有12种取值,即01~12。符合条件的只有01、11和12,其他月份不可能出现顺子。
对于2022-01-dd,只有2022-01-23符合条件
对于2022-11-dd,只有2022-11-23符合条件
对于2022-12-dd,只有2022-12-30和2022-12-31符合条件
答案:
所以答案是:4
试题C:刷题统计
时间限制:1.0s内存限制:256.0MB本题总分:10分
【问题描述】
小明决定从下周一开始努力刷题准备蓝桥杯竞赛。他计划周一至周五每天做a道题目,周六和周日每天做b道题目。请你帮小明计算,按照计划他将在第几天实现做题数大于等于n题?
【输入格式】
输入一行包含三个整数a,b和n.
#include<stdio.h> int main() { int a=0, b=0, n=0; scanf("%d %d %d", &a, &b, &n); int sum = 0; int i = 1; int c = 0; while (sum < n) { if (i % 7 == 0) { sum = sum +b; } else if ((i + 1) % 7 == 0) { sum = sum + b; } else { sum = sum + a; } i++; } printf("%d", i-1); return 0;
边栏推荐
- JS event object offsetx/y clientx y pagex y
- CNN training cycle reconstruction - hyperparametric test | pytorch series (XXVIII)
- 智能工业设计软件公司天洑C轮数亿元融资
- Redis AOF log persistence
- MySQL is shown in the figure. The existing tables a and B need to be associated with a and B tables through projectcode to find idcardnum with different addresses.
- 【微信小程序开发(六)】绘制音乐播放器环形进度条
- Day 8 of DL
- 使用PyTorch的TensorBoard-可视化深度学习指标 | PyTorch系列(二十五)
- style=“width: ___“ VS width=“___“
- Center-based 3D Object Detection and Tracking(基于中心的3D目标检测和跟踪 / CenterPoint)论文笔记
猜你喜欢

Center Based 3D object detection and tracking (centerpoint) paper notes

POC simulation attack weapon - Introduction to nucleus (I)

Redis aof日志持久化

GAMES101复习:光线追踪(Ray Tracing)

Record of a cross domain problem

Constant power wireless charging based on stm32

On the problem that sqli labs single quotation marks do not report errors

Canvas from getting started to persuading friends to give up (graphic version)

智能工业设计软件公司天洑C轮数亿元融资

CNN训练循环重构——超参数测试 | PyTorch系列(二十八)
随机推荐
数据湖:海量日志采集引擎Flume
[image defogging] image defogging based on dark channel and non-mean filtering with matlab code
vscode debug显示多列数据
Explanation of CNN circular training | pytorch series (XXII)
Job 7.27 IO process
[signal processing] weak signal detection in communication system based on the characteristics of high-order statistics with matlab code
[leetcode] 13. linked list cycle · circular linked list
JS event object offsetx/y clientx y pagex y
43.js -- scope chain
clientY vs pageY
Oracle basicfile lob field space recycling shrink space doubts
Introduction to the reduce() function in JS
小程序已获取数据库合集中的总记录、用户位置,怎么用Aggregate.geoNear将经纬度由近到远排列?
[software testing] - unittest framework for automated testing
数字孪生农业丨智慧农业稻米加工厂从“看天吃饭”到“知天而作”
MySQL索引学习
Welcome to CSDN markdown editor Assad
写英文IEEE论文的技巧
[acnoi2022] one step short
Niuke-top101-bm340


