C++用指针构造回文#include#includevoid main(){ char a[20]={0},*p1,*p2; int i; couta; i=strlen(a); p1=&a[i-1]; p2=&a[i]; while(p1) { *p2++=*p1--; } cout

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 00:48:43
C++用指针构造回文#include#includevoidmain(){chara[20]={0},*p1,*p2;inti;couta;i=strlen(a);p1=&a[i-1];p2=&a[i

C++用指针构造回文#include#includevoid main(){ char a[20]={0},*p1,*p2; int i; couta; i=strlen(a); p1=&a[i-1]; p2=&a[i]; while(p1) { *p2++=*p1--; } cout
C++用指针构造回文
#include
#include
void main()
{
char a[20]={0},*p1,*p2;
int i;
couta;
i=strlen(a);
p1=&a[i-1];
p2=&a[i];
while(p1)
{
*p2++=*p1--;
}
cout

C++用指针构造回文#include#includevoid main(){ char a[20]={0},*p1,*p2; int i; couta; i=strlen(a); p1=&a[i-1]; p2=&a[i]; while(p1) { *p2++=*p1--; } cout
while (p1 - a >= 0)
{
...
}
*p2 = '\0';
cout