欧美三区_成人在线免费观看视频_欧美极品少妇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條評論
主站蜘蛛池模板: 福利精品 | 69式互添免费视频 | 午夜精品视频在线观看 | 欧美一区二区三区久久精品 | 香港三级日本三级a视频 | 亚洲日本中文字幕 | 99热久久这里只精品国产9 | 亚洲天堂视频在线观看 | 欧美交 | 国产成人精品一区在线播放 | 亚洲欧美二区三区久本道 | 欧美日韩亚洲一区二区三区在线观看 | 久久久美女 | 一级毛片ab片高清毛片 | 国产一区二区三区久久久久久久久 | 成人在线97| 久久最新 | 妞干网在线观看 | 久久久久久久久久综合 | 草草久久久 | av一级毛片 | 亚洲美女网站 | 亚洲欧美中日韩中文字幕 | 国产免费一区二区在线看 | 欧美乱操 | 国产91小视频在线观看 | 山岸逢花在线观看无删减 | 欧美精品综合一区二区三区 | 很黄很色又爽很黄很色又爽 | 中文字幕亚洲欧美日韩在线不卡 | 亚洲视频在线看 | 狠狠综合久久综合鬼色 | 成人午夜精品久久久久久久小说 | 日日爱夜夜爽 | 黄色视屏免费看 | 成人精品鲁一区一区二区 | 日本www.在线中文字幕 | av在线二区 | 91精品啪国产在线观看免费牛牛 | 91精品国产露脸在线观看 | www.中文字幕|