#include <string.h>
#include <iostream>
using namespace std;
int main(int argc,char** argv)
{
char text[10];
cout<<"请输入一字符串:"<<endl;
cin>>text;
int len=strlen(text);
char* p=text+len;
cout<<"逆序输出为:"<<endl;
while ((p--)!=text)
{
cout<<*p;
}
cout<<endl;
return 0;
}
#include <iostream>
using namespace std;
int main(int argc,char** argv)
{
char text[10];
cout<<"请输入一字符串:"<<endl;
cin>>text;
int len=strlen(text);
char* p=text+len;
cout<<"逆序输出为:"<<endl;
while ((p--)!=text)
{
cout<<*p;
}
cout<<endl;
return 0;
}