#include <iostream>
#include <string.h>
using namespace std;
void invstr(char*s)
{
char *p;
int length=strlen(s);
for(p=s;length>=0;length--)
{
cout<<*(p+length-1);
}
}
int main()
{
char s[100];
cin>>s;
invstr(s);
return 0;
}
C++之用指针倒序输出字符串
最新推荐文章于 2024-05-06 18:06:04 发布