# 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数的引用.....哎！！，没有多大的技巧，所以代码也没有啥好讲解的...

``` 1 #include<stdio.h>
2 #include<stdlib.h>
3 #include<ctype.h>
4 #include<string.h>
5 #pragma warning (disable: 4018)
6 #define MAX 10000
7 char  str[MAX+1];
8 int arr[MAX+1]={0,1,1};
9 int main()
10 {
11     int i,j;
12      for( i=3;i<=MAX;i++)
13   {
14     arr[i]=arr[i-1]+arr[i-2];
15     arr[i]%=26;
16   }
17   while(gets(str)!=NULL)
18   {
19       for( j=1,i=0;i<strlen(str);i++)
20       {
21           if(isupper(str[i]))
22           {
23               str[i]+=arr[j++];
24               while(str[i]>'Z')
25               {
26                 str[i]-=26;
27               }
28
29           }
30           putchar(str[i]);
31       }
32       puts("");
33   }
34     return 0;
35 }```

657 篇文章64 人订阅

0 条评论

## 相关文章

### Code forces 719A Vitya in the Countryside

A. Vitya in the Countryside time limit per test:1 second memory limit per test:2...

3496

1181

### POJ 3673 Cow Multiplication

Cow Multiplication Time Limit: 1000MS Memory Limit: 65536K Total Submiss...

3596

### POJ 1012 Joseph

Joseph Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 53862 ...

3246

### 聊聊storm的GraphiteStormReporter

storm-core-1.2.2-sources.jar!/org/apache/storm/metrics2/reporters/GraphiteStormR...

1411

3194

3506

### POJ 2484 A Funny Game(智商博弈)

Description Alice and Bob decide to play a funny game. At the beginning of the ...

3668

### HDU 1002 A + B Problem II(高精度加法(C++/Java))

A + B Problem II Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/3...

3667

### HDU 3783 ZOJ

ZOJ Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/...

2876