欧美三区_成人在线免费观看视频_欧美极品少妇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條評論
主站蜘蛛池模板: 亚洲影视在线观看 | 呦呦在线视频 | 久久在线看 | 日本黄色性视频 | 久碰香蕉精品视频在线观看 | 久久一区二区精品综合 | 韩国男女无遮挡高清性视频 | 欧美一区二区三区久久久 | 亚洲综合国产 | 久草欧美视频 | 亚洲九九色 | 天天看天天爽天天摸天天添 | 亚洲在线视频观看 | 久久国产乱子免费精品 | 日韩在线aⅴ免费视频 | 麻豆国产 | 日韩国产一区 | www成人国产在线观看网站 | 日日夜夜视频 | 精品二区 | 米奇影院7777 | 色婷婷久久综合中文久久一本 | 一级免费a| 成人夜晚看av | 中文字幕网在线 | 精品日韩 | 激情五月婷婷色 | 岛国av在线 | 澳门一级毛片免费播放 | 日日做日日摸夜夜爽 | 久草综合在线视频 | 又爽又黄又无遮挡的激情视频免费 | 国产午夜精品久久久久久久蜜臀 | 五月天亚洲综合 | 成年人看的羞羞网站 | 草草视频在线观看 | 综合色久| 国产精品日本一区二区不卡视频 | 精品久久成人免费第三区 | 国产原创91| 二区三区偷拍浴室洗澡视频 |