Output limit exceed

Source: Internet
Author: User

Incorrect input format

Output limit exceed is an error that exceeds the output limit (OLE), prompting your program to generate too much output information, usually caused by an endless loop.
The main cause of the above error is that the while (scanf ("% d", & N) loop statement is generated. Because when the scanf function has input data, the return value is the number of data reads. When no data is input, the returned value is-1 (pre-defined as EOF ). For example, if this program reads an N value and 4 and 5 at the beginning of each line in sample input, 1 is returned. If no data is input,-1 is returned, in this case, if the cycle condition is not 0 and permanent, an infinite loop is formed.
Therefore, you need to modify the statement to: While (scanf ("% d", & N )! =-1) or while (scanf ("% d", & N )! = EOF), when no data is input, the cycle condition is 0 and the loop is exited.
Of course, the C language and C ++ input formats are involved here.

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.