HDU 2672 god is a girl
先找规律,发现是斐波那契数列...然后..水题..
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std; int f[];
char s[];
void init()
{
f[]=,f[]=;
for(int i=;i<;i++)
f[i]=(f[i-]+f[i-])%;
} int main()
{
init();
while(gets(s))
{
int tot=;
int len=strlen(s);
for(int i=;i<len;i++)
{
if(s[i]>='A'&&s[i]<='Z')
{
printf("%c",(s[i]-'A'+f[tot])%+'A');
tot++;
}
else printf("%c",s[i]);
}
printf("\n");
}
return ;
}
HDU 2672 god is a girl的更多相关文章
- HDU 2672 god is a girl (字符串处理,找规律,简单)
题目 //1,1,2,3,5,8,13,21,34,55…… //斐波纳契数列 #include<math.h> #include<stdio.h> #include<s ...
- hdu 2669 Romantic (乘法逆元)
Romantic Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- 【转载】图论 500题——主要为hdu/poj/zoj
转自——http://blog.csdn.net/qwe20060514/article/details/8112550 =============================以下是最小生成树+并 ...
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
- HDU 2669 Romantic(裸的拓展欧几里得)
Romantic Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- hdu图论题目分类
=============================以下是最小生成树+并查集====================================== [HDU] 1213 How Many ...
- HDU图论题单
=============================以下是最小生成树+并查集====================================== [HDU] 1213 How Many ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
随机推荐
- Oracle Day3 多行函数、多表查询
1.多行函数 Sum avg max min count 组函数具有滤空的作用(添加nvl屏蔽该功能) 分组group by 多行分组 分组过滤 where 和分组过滤的区别(having) 分组的增 ...
- 错误: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: PC
su - root mkdir temp mv /local/ldconfig apt-get update
- Android中调用系统的相机和图库获取图片
//--------我的主布局文件------很简单---------------------------------<LinearLayout xmlns:android="http ...
- RIDE的使用
在RIDE中,CTRL + R 自动打开report.html , CTRL + L 自动打开 log.html
- 菜鸟认识揭开DLL木马
相信经常玩木马的朋友们都会知道一些木马的特性,也会有自己最喜爱的木马,不过,很多朋友依然不知道近年兴起的“DLL木马”为何物.什么是“DLL木马”呢?它与一般的木马有什么不同? 一.从DLL技术说起 ...
- JavaScript高级程序设计:第十一章
一.选择符API SelectorsAPILevel 1的核心是两个方法:querySelector()和querySelectorAll(). 1. querySelector()方法 queryS ...
- Java静态语句块、语句块、构造方法执行顺序
package com.imooc.practice; class Parent{ public Parent(){ System.out.println("Parent构造方法执行!&qu ...
- hdu_4826_Labyrinth_2014百度之星(dp)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4826 题意:中文题,不解释 题解:dp搞,第一列只能从上往下走,所以先算出第一列的dp数组,然后开两个 ...
- HDU2673:shǎ崽 OrOrOrOrz
Problem Description Acmer in HDU-ACM team are ambitious, especially shǎ崽, he can spend time in Inter ...
- flex、As 3.0 小知识
<s:CheckBox id="checkBox" x="10" y="5" label="{new ObjectProx ...