前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >杭电子科技大学_god ls a girl神翻译

杭电子科技大学_god ls a girl神翻译

作者头像
全栈程序员站长
发布2022-11-08 09:53:44
2920
发布2022-11-08 09:53:44
举报
文章被收录于专栏:全栈程序员必看

god is a girl

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

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

代码语言:javascript
复制
   SGC CGGJX GC BMHVQ BGU BCIHNYNBX GNPLV!

Sample Output

代码语言:javascript
复制
   THE FLOWS OF MAGIC ARE WHIMSICAL TODAY!

Author

Teddy

Source

HDU女生专场公开赛——谁说女子不如男

Recommend

lcy | We have carefully selected several similar problems for you: 2673 2668 2669 2671 2670

代码语言:javascript
复制
#include<stdio.h>
#include<string.h>
int main()
{
	char str1[100000],str2[100000];
	int a[100000],i,t,j;
	memset(str1,0,sizeof(str1));
	while(gets(str1))
	{
     	memset(a,0,sizeof(a));         清零应放在while内
	memset(str2,0,sizeof(str2));
	t=strlen(str1);
	a[0]=1;
	a[1]=1;
	for(i=2;i<t;i++)
	  {
	  a[i]=a[i-1]+a[i-2];
    	while(a[i]>26)
	  a[i]-=26;
      }
     for(i=0,j=0;i<t;i++)
	 {
	 	if(str1[i]>='A'&&str1[i]<='Z')
	 	{
	 	str2[i]=str1[i]+a[j++];
	    if(str2[i]>'Z')
	 	str2[i]-=26;
	    }
	    else
	    str2[i]=str1[i];
		 }	
		 puts(str2);
      }
      return 0;
  }
代码语言:javascript
复制
<pre name="code" class="html">#include<stdio.h>
#include<string.h>
int main()
{
	char str1[100000] ;
	int a[100000],i,t,j;
	while(gets(str1))
	{
	t=strlen(str1);
	a[0]=1;
	a[1]=1;
	for(i=2;i<t;i++)
	  {
	  a[i]=a[i-1]+a[i-2];
    	while(a[i]>26)
	  a[i]-=26;
      }
     for(i=0,j=0;i<t;i++)
	 {
	 	if(str1[i]>='A'&&str1[i]<='Z')
	 	{
	 	str1[i]+=a[j++];
	    if(str1[i]>'Z')
	 	str1[i]-=26;
	    }
		 }	
		 puts(str1);
      }
      return 0;
  }
代码语言:javascript
复制

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/184519.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年10月8日 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • god is a girl
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档