/*Description
输入一行字符串(只包含字母),截取最后一位放首位,然后其它的取每一位给asc码+3 。测试数据有多组,一次性输入与输出。
Input
Output
Sample Input
asdf
awxz
Sample Output
fdvg
zdz{
HINT
*/
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
char str[100];
int i;
int b;
char c;
while(scanf("%s",str)!=EOF)
{
b=strlen(str);
c=str[b-1];
for(i=b-1;i>0;i--)
str[i]=str[i-1]+3;
str[0]=c;
puts(str);
}
return 0;
}
运行结果:
最后
以上就是明亮含羞草最近收集整理的关于计161_Problem : 字符串操作二(串)的全部内容,更多相关计161_Problem内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复