#include
int func1(char *d, char *s)
{
int i;
for(i = 0; s[i]; i++)
d[i] =s[i];
d[i] = 0;
return i;
}
int func2(char *d, char *s)
{
char *p = d;
while(*s)
{
*p++=*s++;
}
*p = 0;
return p-d;
}
int main()
{
int i;
char s[100],p[100];
while(1)
{
int l;
printf("input a string:");
scanf("%s",s);
printf("input select: 1,method 1; 2,method 2; other, quit\n");
scanf("%d",&i);
if(i == 1)
l = func1(p, s);
else if(i == 2)
l = func2(p, s);
else break;
printf("%s:%d\n", p, l);
}
return 0;
}