# Include <iostream>
# Include <string>
Using namespace STD;
Void main ()
{
Char Buf [40], largest [40];
Int curlen, maxlen =-1, CNT = 0;
Cout <"input word:/N ";
While (CIN> BUF)
{
Curlen = strlen (BUF );
CNT ++;
If (curlen> maxlen)
{
Maxlen = curlen;
For (INT I = 0; I <40; I ++)
{
Largest [I] = Buf [I];
}
}
}
Cout <CNT <Endl;
Cout <maxlen <Endl <largest <Endl;
}
ThisProgramThe intention is to calculate the number of words input from the keyboard, find the most character word from it, and output Its Character Count and word character.
The following are my problems:
Enter happier people can be more successful, because they have more energy
Enter Ctrl + Z to stop running the program. Why?
Please discuss
Below is what I found out:
Enter happier people can be more successful, because they have more energy, and press ENTER
Then press Ctrl + Z to run the program.
The execution result is as follows:
Is it the role of enter Jian, rather than the end?
I found the answer from the Internet: Windows operating system file Terminator mark
Press enter, press Ctrl + Z, and then press Enter.