本文共 695 字,大约阅读时间需要 2 分钟。
c语言 字符串字符反向储存
Here you will get C++ program to reverse a string.
在这里,您将获得C ++程序来反转字符串。
The user is asked to enter a string and then the reverse of the string is displayed.
要求用户输入一个字符串,然后显示该字符串的反面。
For example:
例如:
Input String: hello
输入字符串:hello
Output String: olleh
输出字符串:olleh
#include#include #include int main(){ char a[50],temp; int i,j,len; cout<<"Enter any string:\n"; gets(a); len=strlen(a); cout<<"Reverse of the string is: "; for(i=0,j=len-1;i
Output
输出量
Comment below if you are facing any difficulty to understand above program.
如果您在理解上面的程序时遇到任何困难,请在下面评论。
翻译自:
c语言 字符串字符反向储存
转载地址:http://ngwwd.baihongyu.com/