NOJ [1263] All Kill
来源:互联网 发布:软件架构师常用工具 编辑:程序博客网 时间:2024/06/06 07:35
- 问题描述
- Now is the Z country's extraordinary period,Ning x City broke out in a procession, the relevant departments accidentally get some data, by analysis,
this is M country' ciphertext. . . Now, we get the correct way to decryption .
Now,you have to do it, for each of the ciphertext, presence a number x of corresponding , represents the originaltext. moved to the right of the x-bit to get
ciphertext, and now output correct the original.If you donn't,you will be kill !!! - 输入
- This problem contains several cases.
The first line of each case is the ciphertext(the length < 100000).
The next line is the number,that is every ciphertext'x. - 输出
- printf the originaltext. You have to leave a blank line between each two cases.一开始把Case写成了CASE。。。。。。大家不要犯这种低级错误啊
#include<stdio.h>#include<string.h>char ciphertext[100010];char number_x[100010];char originaltext[100010];int main(){int p=1;while(~scanf("%s",ciphertext)){scanf("%s",number_x);int len=strlen(ciphertext),i;for(i=0;i<len;i++){if(ciphertext[i]>='a' && ciphertext[i]<='z')//小写字母{char c=ciphertext[i]-'a'-(number_x[i]-'0')+'a';if(c>='a') originaltext[i]=c; else originaltext[i]='z'-('a'-c)+1;} else if(ciphertext[i]>='A' && ciphertext[i]<='Z'){char c=ciphertext[i]-'A'-(number_x[i]-'0')+'A';if(c>='A') originaltext[i]=c; else originaltext[i]='Z'-('A'-c)+1;}}originaltext[len]='\0';if(p>1) printf("\n"); printf("Case %d: %s\n",p,originaltext);p++;}return 0;}
0 0
- NOJ [1263] All Kill
- NOJ 1127 Kill the Zombies
- linux kill all proccess
- linux shell中kill 和kill all 分析
- Kill All Active Connections To A Database.
- kill all process by input process name
- [SPOJ INS14G Kill them All]数学、排列组合
- Noj
- kill all the process under the same username
- kill
- kill
- kill
- kill
- kill
- kill
- kill
- kill
- 【转】Programmers Need To Learn Statistics Or I Will Kill Them All
- 最短摘要生成
- leetcode:Search a 2D Matrix
- IO之字节字符转换流
- 苹果iOS 7鲜为人知的功能
- Learn these technical skills within one day
- NOJ [1263] All Kill
- leetcode:
- 【娱见一周】企鹅插手,乐视TV与360谈判峰回路转?
- MyEclipse-7.5.0版注册码破解及激活操作
- printf的格式控制的完整格式
- java模拟时钟
- 小谈学生团队管理
- 三角形失真解决方法和纵横比的关系
- BIEE11G系统数据源账号过期问题(默认安装步骤)