* Loop-01. Evaluate the integer segment and [help]

Source: Internet
Author: User

1/* 2 * Main. c 3 * loop-01. calculate the integer segment and 4 * Created on: June 18, 2014 5 * Author: Boomkeeper 6 *** test wood has passed the *** 7 */8 9 # include <stdio. h> 10 # include <stdlib. h> 11 12 int main () 13 {14 int a, B, sum; 15 scanf ("% I", & a, & B ); 16 17 if (a> B) 18 exit (0); 19 20 {21 int I = 0, count = 0; 22 for (I = a; I <= B; I ++) 23 {24 printf ("% * I", 5, I); 25 count ++; 26 if (count = 5 & I! = B) // if the number is 5 and not the last one, wrap 27 {28 printf ("\ n"); 29 count = 0; 30} 31 sum + = I; 32} 33} 34 printf ("\ nSum = % I \ n", sum); 35 return 0; 36}

This is a tough issue. It's not difficult, but it's wrong! The result is the following... please give us some advice. It's been a long time since there were spaces on the screen...

 

Link: http://pat.zju.edu.cn/contests/basic-programming/%E5%BE%AA%E7%8E%AF-01

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.