游客 Signup | Login
中文 | En

1302 - C语言程序设计教程(第三版)课后习题3.7

要将"China"译成密码,译码规律是:用原来字母后面的第4个字母代替原来的字母.例如,字母"A"后面第4个字母是"E"."E"代替"A"。请编一程序,用赋初值的方法使cl、c2、c3、c4、c5五个变量的值分别为,'C’、'h’、'i’、'n’、'a’,经过运算,输出变换后的密码。

Input

Output

加密后的China

Examples

Input

no input needed

Output

Glmre

Hint

so easy

Solution C

#include <stdio.h>  
main()   
{
char c1='C',c2='h',c3='i',c4='n',c5='a';  
  c1+=4;  
  c2+=4;  
  c3+=4;  
  c4+=4;  
  c5+=4;  
  printf("%c%c%c%c%c\n",c1,c2,c3,c4,c5);  
}

Solution C++

#include<iostream>
int main()
{
  printf("Glmre");
  return 0;
}

Hint

so easy

Time Limit 1 second
Memory Limit 64 MB
Discuss Stats
上一题 下一题