当前位置:网站首页>What happened to redraiment
What happened to redraiment
2022-07-19 06:54:00 【winkiii】
describe
Redraiment My hometown lives in an industrial area , Daily power consumption is very large . It is a thorn in the side of the government , But there's no way , People who live here are all big taxpayers . This year, 7 month , Sad news came again , The government is going to 7、8 In June, the district will be switched off and power rationed . But under pressure , The rules of power rationing system will not be too stingy , The government decided to start from 7 month 1 Daily power failure , Then arrive every other day 7 month 3 The power will be cut off again on the th , Another two days later 7 month 6 Daily power failure , Go down at one time , Each time is one day later than the last time . Redraiment But software majors , How can I live without a computer . If there is a power failure , Just “ Heroes have no place ” 了 . ha-ha . So he began to calculate the day when he would go home , He wants to know how many days of unlucky power failure he will experience when he gets home . Can you help him calculate ?
Input
Input includes multiple sets of data . Each set of data includes a row :redraiment The date of arrival . Enter to 0/0 end .
Output
Each input includes an output .
by redraiment Days of power failure after going home ( Including the day when I get home ).
sample input 1
8/31
0/0
sample output 1
0
#include<stdio.h>
int main(){
int m,d;
int day[63]; // Pay attention to array bounds
int i=1,t=1,j;
for(j=1;j<=62;j++){
// Every day in July and August is uniformly set as 1
day[j] = 1;
}
while(i<=62){
// Set the day of power failure as 0
day[i] = 0;
t++;
i+=t;
}
while(scanf("%d/%d",&m,&d)){
if(m==0&&d==0) break;
int td = 0; // The number of days of power failure that have passed
if(m==7){
int k;
for(k=1;k<d;k++){
if(day[k]==0){
td++;
}
}
}
else if(m==8){
td = 7; // There was a total power outage in July 7 God
int k;
for(k=1;k<d;k++){
if(day[k+31]==0){
// August subscript needs to add 31
td++;
}
}
}
else{
// Divide by seven 、 Power cuts in other months of August will not be considered , It is temporarily considered that there is no power cut
td = 10;
}
printf("%d\n",10-td);
}
}
边栏推荐
- 简单irules编写 入门级
- Pytorch deep learning practice-b station Liu erden-day5
- Share the successful cooperation between CS brand sdnand and wearable devices
- Information on successful cooperation between CS brand sdnand and stm32mcu
- Good partner of single chip microcomputer - CS Genesis SD NAND flash
- 基于SPI/IIC接口的OLED数据显示
- NAND nor flash flash flash product overview
- 总价合同、成本补偿合同、工料合同
- 使用Altium Designer软件绘制一个基于stm32设计
- What is tsd/qsd? What is CS Genesis SD NAND?
猜你喜欢
![[ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :](/img/dd/054af819c8bdca31bd135495386fb4.png)
[ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :

F5 GTM(一):DNS参数
![[CS Genesis] comparative analysis of advantages and disadvantages of SD NAND and raw NAND](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[CS Genesis] comparative analysis of advantages and disadvantages of SD NAND and raw NAND

Share the application cases of CS brand patch T card in the field of hunting camera

mass data

Full experience of soft examination at the beginning, middle and advanced levels

Information on successful cooperation between CS brand sdnand and stm32mcu

高并发day01(NIO、ConCurrent包)

F5ltm (I) logic diagram

What is data center?
随机推荐
Sed command of text three swordsman -- text replacement; Grep command - text filtering
How to make good use of cost compensation contract in government procurement
开发板训练:STM32下的多任务程序
Release nohup Out disk space occupied
Application case of CS brand sdnand in color detector industry
Learning about STM assembler design
Entry level of simple irules writing
伺服电机的电子齿轮比如何确定?
手动字符串比较(指针题)
Wu Enda machine learning chapter 3-4
小迪网络安全笔记-信息收集-架构、搭建、waf(8)
Tcp/ip four layer model and related configurations of F5
Talk about Zhongtai: my understanding and thinking about Zhongtai
释放nohup.out占用的磁盘空间
企业数据治理之勒索病毒篇
Slag learning road (2) pure white direction: win Server 2003 server building
tail -f暂停方法
Gnome 安装扩展插件(40.1版本,opensuse tumbleweed)。
STM32串口通信相关学习
【自动化测试】——robotframework实战(三)编写测试用例