C ++ file Terminator

Source: Internet
Author: User

# 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.