CodeForces - 816A Karen and Morning 解题
这个题比较水~~~
1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 int a=0,b,i,j; 6 char str1[6],str2[6]; 7 scanf("%s",&str1); 8 for(i=0;;i++) 9 { 10 for(j=0;j<5;j++) 11 { 12 str2[j]=str1[4-j]; 13 } 14 if(strcmp(str1,str2)==0) 15 { 16 printf("%d",a); 17 return 0; 18 } 19 str1[4]+=1; 20 a++; 21 if(str1[4]=='9'+1) 22 { 23 str1[4]='0'; 24 str1[3]+=1; 25 } 26 if(str1[3]=='6') 27 { 28 str1[3]='0'; 29 str1[1]+=1; 30 } 31 if(str1[1]=='9'+1) 32 { 33 str1[1]='0'; 34 str1[0]+=1; 35 } 36 if(str1[0]=='2'&&str1[1]=='4') 37 { 38 str1[0]='0'; 39 str1[1]='0'; 40 str1[3]='0'; 41 str1[4]='0'; 42 } 43 } 44 }
转载于:https://www.cnblogs.com/lyf0031/p/7204475.html
CodeForces - 816A Karen and Morning 解题相关推荐
- Codeforces Round #702 (Div. 3)解题报告
Codeforces Round #702 (Div. 3) 全部题解 读错题意,写了半天真是心态爆炸,总的来看这次题目不难的. A. Dense Array http://codeforces.co ...
- codeforces A. Jeff and Digits 解题报告
题目链接:http://codeforces.com/problemset/problem/352/A 题目意思:给定一个只有0或5组成的序列,你要重新编排这个序列(当然你可以不取尽这些数字),使得这 ...
- codeforces B. Eight Point Sets 解题报告
题目链接:http://codeforces.com/problemset/problem/334/B 一开始看到题目,有点怯,理解了题目后,其实并不难.这句话是突破口 three distinct ...
- codeforces 450B. Jzzhu and Sequences 解题报告
题目链接:http://codeforces.com/problemset/problem/450/B 题目意思:给出 f1 和 f2 的值,以及n,根据公式:fi = fi-1 + fi+1,求出f ...
- codeforces 435 B. Pasha Maximizes 解题报告
题目链接:http://codeforces.com/problemset/problem/435/B 题目意思:给出一个最多为18位的数,可以通过对相邻两个数字进行交换,最多交换 k 次,问交换 k ...
- codeforces B. Fox and Cross 解题报告
题目链接:http://codeforces.com/problemset/problem/389/B 题目意思:给出一个由n行n列组成的board,其中'#'表示的一片地方恰好能画满十字架,画满的意 ...
- codeforces 483B Friends and Presents 解题报告
题目链接:http://codeforces.com/problemset/problem/483/B 题目意思:有两个 friends,需要将 cnt1 个不能整除 x 的数分给第一个friend, ...
- codeforces 476B.Dreamoon and WiFi 解题报告
题目链接:http://codeforces.com/problemset/problem/476/B 题目意思:给出两个字符串str1, str2,其中,str1 只由 '+' 和 '-' 组成,而 ...
- codeforces B. The Fibonacci Segment 解题报告
题目链接:http://codeforces.com/problemset/problem/365/B 题目意思:简单来说,就是要找出最长的斐波纳契长度. 解决的方法不难,但是要注意更新左区间和右区间 ...
- codeforces 463C. Gargari and Bishops 解题报告
题目链接:http://codeforces.com/contest/463/problem/C 题目意思:要在一个 n * n 大小的棋盘上放置两个bishop,bishop可以攻击的所有位置是包括 ...
最新文章
- Adobe奇葩续费机制被网友狂喷:一不留神就扣2500,按月付费还随时取订?长点心吧...
- 前嗅ForeSpider中数据采集界面介绍
- commons-logging和log4j
- 【Linux】一步一步学Linux——ssh-agent命令(181)
- 在 Azure Functions 上使用不同的路由前缀
- 关于网页授权的两种scope的区别说明
- PM早知道:电子身份证是个啥?
- 雷鸟下载器v3.0.0 百度网盘第三方不限速下载工具
- css3禅密花园叫什么名字_CSS秘密花园: 自定义下划线
- 基于visual Studio2013解决C语言竞赛题之1044数组处理
- hdu 1710 Binary Tree Traversals (二叉树)
- Pandas——merge(合并)
- Universal Link 用企业证书build包,可以通过链接拉起绑定的App(客户端)
- python制作模型排放清单_四川省人为源大气污染物排放清单及特征
- Lua学习---编译生成lua和luac
- Windows下DOS/bat命令行下载网络文件
- Mysql索引结构全维度比较
- 在这个项目的心得体会和经验教训
- Matlab之函数参数nargin和nargout
- 滑动到尽头时去掉阴影效果
热门文章
- error: statement with no effect [-Werror=unused-value]
- libtool: Version mismatch error
- MIPS指令集确实够精简,编译文件明显小
- 又漏了一张发票,所以报销要及时
- LINUX检查一个进程内存增长的脚本
- 为什么动物不需要吃盐
- Writing Serializable Classes---定义可序列化的类
- android 单独编译contacts,Android编译全过程
- mp3 播放自动 html5,HTML5打造简易播放器:Chrome运行.mp3
- matlab生成网络流量,BP神经网络 预测网络流量