C Language Programming skills (note points)

Source: Internet
Author: User

Assume that all variables are already defined. Most symbols are full-width symbols, and the code cannot be copied directly, only for reference.

1. When comparing two data, try to put known quantity in front. For example: a = 2;scanf ("%d", &b); if (a > B) {...}; It is not recommended to write if (b > a) {...}

2. The program exports as little as possible, that is, the return statement as little as possible. For example: Find the maximum number of a,b,c, only the last return maximum.

3. About scanf ("%d%d", &a,&b), two%d can be added to a variety of symbols, such as%d,%d, the middle of a comma, which means that the program executes to this statement, the input of the two data between the comma (23,45), proposed to write%d%d, Without any symbols in the middle.

C Language Programming skills (note points)

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.