uva-458 - The Decoder
来源:互联网 发布:腾讯数据分析工程师 编辑:程序博客网 时间:2024/05/16 07:57
Write a complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a simple coded set of characters and print the exact message that the characters contain. The code key for this simple coding is a one for one character substitution based upon a single arithmetic manipulation of the printable portion of the ASCII character set.
Input and Output
For example: with the input file that contains:
1JKJ'pz'{ol'{yhklthyr'vm'{ol'Jvu{yvs'Kh{h'Jvywvyh{pvu51PIT'pz'h'{yhklthyr'vm'{ol'Pu{lyuh{pvuhs'I|zpulzz'Thjopul'Jvywvyh{pvu51KLJ'pz'{ol'{yhklthyr'vm'{ol'Kpnp{hs'Lx|pwtlu{'Jvywvyh{pvu5
your program should print the message:
*CDC is the trademark of the Control Data Corporation.*IBM is a trademark of the International Business Machine Corporation.*DEC is the trademark of the Digital Equipment Corporation.
Your program should accept all sets of characters that use the same encoding scheme and should print the actual message of each set of characters.
Sample Input
1JKJ'pz'{ol'{yhklthyr'vm'{ol'Jvu{yvs'Kh{h'Jvywvyh{pvu51PIT'pz'h'{yhklthyr'vm'{ol'Pu{lyuh{pvuhs'I|zpulzz'Thjopul'Jvywvyh{pvu51KLJ'pz'{ol'{yhklthyr'vm'{ol'Kpnp{hs'Lx|pwtlu{'Jvywvyh{pvu5
Sample Output
*CDC is the trademark of the Control Data Corporation.*IBM is a trademark of the International Business Machine Corporation.*DEC is the trademark of the Digital Equipment Corporation.
#include<stdio.h>
#include<string.h>
int main()
{
int i,n;
char str[100000];
while(gets(str)!=NULL)
{
n=strlen(str);
for(i=0;i<n;i++)
{
printf("%c",str[i]-7);
}
printf("\n");
}
return 0;
}
- Uva 458 - The Decoder
- UVa 458 - The Decoder
- uva 458 The Decoder
- UVA 458 - The Decoder
- uva-458 - The Decoder
- uva 458 The Decoder
- UVa 458 - The Decoder
- UVA 458 The Decoder
- UVA - 458 - The Decoder
- UVa 458 - The Decoder
- UVa 458 - The Decoder
- UVA 458 The Decoder
- UVA 458 The Decoder
- UVA - 458 The Decoder
- UVA - 458 The Decoder
- UVA 458 The Decoder
- UVA 458-The Decoder
- uva 458 The Decoder
- HDU 1049 ( Climbing Worm )
- cannot generate SSPI context
- MS12-020 远程桌面漏洞
- linux驱动程序调试常用方法
- CGAL读取一个三维空间边的两个端点坐标
- uva-458 - The Decoder
- 区分给定序列为合法序列
- uva-10300 - Ecological Premium
- uva-10071 - Back to High School Physics
- [实用]19个Web开发者必备速查表(多图)
- 开发者应该关注的五项Web新兴技术
- 细节决定成败——Web设计的5个要点
- 最常被程序员们谎称读过的计算机书籍
- “亚研三日游”感想