#include<iostream>
using namespace std;
void daoxu(char *p)
{
int i,j,len;
char *q=NULL,t;
for(len=0;*(p+len)!=0;len++)
q=p+len;
while(p<q)
{
t=*p;*p=*q;*q=t;
p++;q--;
}
}
int main()
{
char s[80];
cin.getline(s,80);
daoxu(s);
cout<<"倒序后:";
cout<<s<<endl;
return 0;
}
c++字符串倒序
最新推荐文章于 2023-09-17 16:39:55 发布