欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

The Decoder - UVa458

系統 2199 0

歡迎訪問我的新博客: http://www.milkcu.com/blog/

原文地址: http://www.milkcu.com/blog/archives/uva458.html

題目描述



? The Decoder ?

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{pvu5
1PIT'pz'h'{yhklthyr'vm'{ol'Pu{lyuh{pvuhs'I|zpulzz'Thjopul'Jvywvyh{pvu5
1KLJ'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{pvu5
1PIT'pz'h'{yhklthyr'vm'{ol'Pu{lyuh{pvuhs'I|zpulzz'Thjopul'Jvywvyh{pvu5
1KLJ'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>
int main(void) {
	char s1[] = "1JKJ'pz'{ol'{yhklthyr'vm'{ol'Jvu{yvs'Kh{h'Jvywvyh{pvu5";
	char s2[] = "*CDC is the trademark of the Control Data Corporation.";
	int i = 0;
	while(s1[i] != '\0') {
		printf("%4d%4d\n", s1[i], s2[i]);
		i++;
	}
	return 0;
}
  

解碼規則是ASCII碼值減7。

代碼實現

    #include <stdio.h>
int main(void) {
	int c;
	while((c = getchar()) != EOF) {
		if(c == '\n') {
			putchar('\n');
		} else {
			putchar(c - 7);
		}
	}
	return 0;
}
  

(全文完)

The Decoder - UVa458


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 久久青青草视频 | 91中文在线观看 | 欧美一级片免费看 | 亚洲日韩欧美一区二区在线 | 久久久久久成人精品 | 成人午夜视频在线播放 | 日韩中文字幕一区 | 日日摸天天碰中文字幕 | 亚洲综合婷婷 | www.75zzz.com | 亚洲天堂久久 | 免费欧美| 欧美亚洲福利 | 久草观看视频 | 精品中文字幕一区 | 天天色色色 | 色婷婷久久综合中文久久一本 | 免费成人在线网站 | 成人在线免费视频观看 | 天天影视插插 | 9999网站| 国产欧美精品在线 | 亚洲码专区 | 国产成人lu在线视频 | 亚洲欧美无人区乱码 | 欧美精品日韩一区二区三区 | 天天色天天操天天射 | 一区二区三区免费在线 | 狠狠久久| 国产精品二区三区 | 狠狠色丁香婷婷综合久久片 | 色婷婷99综合久久久精品 | 黄色7777| 日韩欧美片 | 欧美激情视频一区二区三区在线播放 | 日本黄页网站免费 | www.色.com| 日韩av中文| 日韩经典欧美一区二区三区 | 一道本视频在线观看 | 久久中文字幕在线 |