#include<bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
freopen("in.txt","r",stdin);
char s[100];
gets(s);
cout<<s<<endl;
char *p=s; //指针指向数组的首地址
int len=strlen(s);
for(int i=0;i<len;i++){
cout<<*p;
p++;
}
cout<<endl;
//指针指向数组的首地址;通过for语句输出
p=s;
for(int i=0;i<len;i++){
cout<<*p;
p++;
}
cout<<endl;
//指针指向数组的首地址 通过while循环输出
p=s;
while(p<s+len){
cout<<*p;
p++;
}
p=s;
while(*p!='\0'){
cout<<*p;
p++;
}
return 0;
}
/指针遍历字符串
int main(int argc, char** argv) {
freopen("in.txt","r",stdin);
string s;
getline(cin,s);
char *p=&s[0];
while(*p!='\0'){
cout<<*p;
p++;
}
return 0;
}