欧美三区_成人在线免费观看视频_欧美极品少妇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條評論
主站蜘蛛池模板: 一级特黄特黄毛片欧美的 | 婷婷免费视频 | 欧美日一区 | 久久精品一区二区国产 | 国产99精品一区二区三区免费 | 成人三区 | 狠狠色噜噜狠狠狠狠97影音先锋 | 成人国产激情福利久久精品 | 日本福利在线观看 | 天天操,夜夜操 | 欧美日韩一区二区三区自拍 | 久久亚洲精品中文字幕二区 | 久久综合九色综合欧洲色 | 国产精品成人在线 | 日韩在线无 | 久久xxx | 免费特黄一级欧美大片在线看 | 久久亚洲最大成人网4438 | 国产精品v欧美精品v日韩精品 | 看免费5xxaaa毛片 | 日韩有码一区 | 性做爰片免费视频毛片中文ILO | 亚洲欧美中文日韩在线v日本 | 欧美在线观看视频网站 | 国产精品自拍99 | 亚洲网站色| 亚洲精品福利在线 | 羞羞操 | a级特黄的片子 | 国产精品果冻麻豆精东天美 | 日本在线播放一区二区 | 色综合网亚洲精品久久久 | 一区二区久久 | 日本久久久久中文字幕 | 成人精品国产 | 欧美精品久久久 | 欧美久久亚洲精品 | 亚洲一区二区视频在线观看 | 奇米影视8888狠狠狠狠 | 天天操综合 | 大片毛片 |