请教各位大师,怎么结果不对,我想了一个晚上也没想明白,初学者请教各位大师了!
#include <iostream>int main()
{
char a[20],*p;
int i=0;
p=a;
while(*p!='\0')
{
scanf("%c",p++);
}
p=a;
while(*p!='\0')
{
printf("%c",*p++);
}
return 0;
}
#include <stdio.h> int main(void) { char str[32]; char *p = str; scanf("%30s", str); while (*p != '\0') putchar(*p++); return 0; }
#include <stdio.h> #define N 10 int main(void) { char a[N + 1] = {0}, *p; for(p = a; p < &a[N]; p++) *p = getchar(); *p = '\0'; for(p = a; *p != '\0'; p++) puts(p); return 0; }