C-language-scanf function supplement

Source: Internet
Author: User

About the scanf function supplement

1 about "character" and "integer" Mixed input

< spaces >< commas >< carriage returns > both are characters, when entered, characters cannot be preceded by these

2 "integer" and "integer" Mixed input

Two "integer" is written in one piece, must have < space >< comma >< carriage return, otherwise it will be treated as a

For example: 1 and 1, if not split, it's 11.

3 "After the project in actual combat, all separated by commas

* When there are characters: scanf ("%d,%c,%d", a,ch,b); Input time: 23,a,3 print Out is: 3 A

* No characters at the time: scanf ("%d%d%d", a,b,c); Input time:90< space >4< space >123 print out is: 90 4 123

C-language-scanf function supplement

Related Article

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.