god is a girl

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1135    Accepted Submission(s): 514

Problem Description
One day,when I was dreaming,god went into my dream,she was pretty cute,just like /^_^\... I really wanted to talked to her,but my English was so poor and she was not a national god but a foreign one...After thirty minutes,she flew away...but story was not finished here,she had left a letter for me!!!What puzzled me so much is the letter was encoded.I had thought for many days,but still can't get it. Now I turn to you for help,with some limited prompts,can you help me to decode the whole letter?
Prompts: GDJIJ,EL SSJT UT YWOSQNIVZMI. -> HELLO,MY NAME IS LINDAINVERS. CN WLP JRVMFGQ BVR,IJCFI? -> DO YOU REQUIRE AID,HUMAN? NMAB VYNNF, FI'E VC HP IXJ ZLQZI. -> ONCE AGAIN, IT'S UP TO THE ELVES. ...
 
Input
There is multy cases,please process to EOF. Each case is one line of string with uppercase letters and white spaces and other symbols.
 
Output
One line of the decoded string.
 
Sample Input
SGC CGGJX GC BMHVQ BGU BCIHNYNBX GNPLV!
 
Sample Output
THE FLOWS OF MAGIC ARE WHIMSICAL TODAY!
 
Author
Teddy
 

做了两小时,一直在找规律,最后将几个句子反复对比才发现是fibonacci数的引用.....哎!!,没有多大的技巧,所以代码也没有啥好讲解的...

就是先暴力一下打一张漂亮的斐波列数表,当然数据范围是在0~25之间----为防止‘A’+25不至于超出范围,当然其他数据如‘B’+25超出了范围,则
要减去26直到最后的数不大于‘Z’即可。
 #include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
#pragma warning (disable: 4018)
#define MAX 10000
char str[MAX+];
int arr[MAX+]={,,};
int main()
{
int i,j;
for( i=;i<=MAX;i++)
{
arr[i]=arr[i-]+arr[i-];
arr[i]%=;
}
while(gets(str)!=NULL)
{
for( j=,i=;i<strlen(str);i++)
{
if(isupper(str[i]))
{
str[i]+=arr[j++];
while(str[i]>'Z')
{
str[i]-=;
} }
putchar(str[i]);
}
puts("");
}
return ;
}

最新文章

  1. 萌新笔记——linux下查看内存的使用情况
  2. 4412开发板学习笔记-NFS服务器的搭建
  3. 软件工程—我的IT的新篇章
  4. 程序Bug---易错点
  5. 简单使用SQLite 的增删改查
  6. unity3d模型制作规范
  7. 增加字段关联插件 For PHPCMS V9 免费版
  8. android SurfaceView绘制 重新学习--基础绘制
  9. mysql 异常处理实例
  10. 跟着内核学框架-从misc子系统到3+2+1设备识别驱动框架
  11. 移动端 canvas插入多张图片生成一张可保存到手机图片
  12. 使用lamdba函数对list排序
  13. [Kafka] [All about it]
  14. mysql链接服务器,update报错
  15. 单源最短路——Dijkstra模板
  16. #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
  17. Mac Lion Configure Apache
  18. Django:Django Rest Framework
  19. 基于Tomcat 的WEB Project存在的安全漏洞总结
  20. 关于虚拟机安装mac os 教程详解

热门文章

  1. Linux安装配置JDK
  2. Create Custom Modal Dialog Windows For User Input In Oracle Forms
  3. MyBatis 多表联合查询及优化 以及自定义返回结果集
  4. 格式化时间(SimpleDateFormat)
  5. 自定义类型转换器converter
  6. Java、fileless恶意软件威胁桌面安全
  7. web设计经验&lt;二&gt;设计华丽的用户体验的6个热门技巧
  8. android MTK驱动背光唤醒流程
  9. JavaWeb学习总结(一)—JavaWeb开发入门及环境搭建
  10. vim的配置文件及常用的快捷键