Home > Back-end >  Urgent urgent help!!!!!!!!!!
Urgent urgent help!!!!!!!!!!

Time:06-02

As shown in figure to run the program after the input value will never get a second input number
How change

CodePudding user response:

Annotate source don't map, want to do is hard to get! Remember the text content

1 m, n does not give initial value is m++, n++, unsafe

After 2 cat (p1, p2) results in the p1, but you don't call printf output p1 content, where will show you the execution result of
Now show is to determine the length of the string before the printf function results

3 while statement is very strange, use the if alternative to the more reasonable, where otherwise infinite loop back not to come out

CodePudding user response:

3 while (I==1) that, if I were 1, die circulation not to come out here, endlessly repeated calls to cat function

CodePudding user response:

Fun
reference 1 floor response:
don't map source code, want to do notation is hard to get! Remember the text content

1 m, n does not give initial value is m++, n++, unsafe

After 2 cat (p1, p2) results in the p1, but you don't call printf output p1 content, where will show you the execution result of
Now show is to determine the length of the string before the printf function results

3 while statement is very strange, use the if alternative to the more reasonable, otherwise, where is the infinite loop back not to come out
yeah yeah thank guidance I'll go to change line not line

CodePudding user response:

#include
Int main ()
{
Int m=0, n=0, I;
Float char (cat a1 [], char a2 []);
Char [30] p1, p2 [30].
Gets (p1);
Gets (p2);
While (p1 [m].='\ 0')
m++;
While (p2 [n].='\ 0')
n++;
If (m> N)
{puts (p1);
I=1; }
Else if (m{puts (p2);
I=1; }
The else
{puts (" equal ");
i=0; }
If (I==1)
The cat (p1, p2);
Printf (" % s ", (p1);
return 0;
}
Float char (cat a1 [], char a2 [])
{int j, k;
for(j=0; A1 [j].='\ 0'; j++);
for(k=0; A2 [k]!='\ 0'; K++);
{
A1 [j]=a2 [k].
j++;
}
A1 [j]='\ 0';
return 0;
}

CodePudding user response:

It still won't do for bosses

CodePudding user response:

Float char (cat a1 [], char a2 [])
{int j, k;
for(j=0; A1 [j].='\ 0'; j++);
for(k=0; A2 [k]!='\ 0'; K++ );
the extra semicolon{
A1 [j]=a2 [k].
j++;
}
A1 [j]='\ 0';
return 0;
}

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related