458 - The Decoder

题目大意:

题目原文http://uva.onlinejudge.org/external/4/458.pdf

解密一段文字。。。以ASCII码判断一下就知道相差7.。。

我们只要逐个ASCII码减7然后输出就可以了。。要注意的是,碰到回车要直接输出回车。。。

参考代码:

View Code
 1 #include<stdio.h>
 2 int main()
 3 {
 4  char c;
 5  while(scanf("%c",&c)!=EOF)
 6  {
 7   if(c!='\n') printf("%c",c-7);
 8   else printf("\n");
 9  }    
10  return 0;
11 }

 

posted on 2013-02-12 00:07  T^T  阅读(140)  评论(0编辑  收藏  举报

导航