1097:字符串问题

来源:互联网 发布:金曲软件 编辑:程序博客网 时间:2024/06/15 06:44

1097:字符串问题


Description


字符串处理在计算机中有很多复杂的操作,但是这些复杂的操作都是由基本的字符串操作复合而成,要求编写一字符串颠倒的程序,把字符串中的字符颠倒位置。


Input


输入一字符串(<255)。


Output


按位进行颠倒的结果。


Sample Input


COMPUTER


Sample OUtput


RETUPMOC


#include<iostream>#include<stdio.h>#include<string.h>using namespace std;int main(){   char a[100];    int n;  gets(a);  n=strlen(a);  int i;  for(i=n-1;i>=0;i--)  {      printf("%c",a[i]);  }    return 0;  }



原创粉丝点击