current position:Home>How do I change this problem

How do I change this problem

2022-02-04 17:20:01 CSDN Q & A

img

img




Take the answer :

Self use for loop , Subscript to be a, Small label as b, Add it up .



Other answers 2:

You put the first 9 Line to line 7 After line


Other answers 3:

1、 Exchange two numbers ,

if(a>b){a=a^b;b=a^b;a=a^b;}

2、sum=0; assignment
3、

for(i=a;i<b;i++)sum+=i;

4、 Don't define too many variables
Sort it out

int a,b,i,sum=0;scanf(.....,&a);scanf(.....,&b);if(a>b){a=a^b;b=a^b;a=a^b;}//a Less than bfor(i=a;i<b;i++)sum+=i;printf(......);

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/02/202202041719598877.html

Random recommended