Home > Back-end >  Big help this two C program to do? 14 and 15
Big help this two C program to do? 14 and 15

Time:06-03

Hope leaders help 14 15 basic ideas won't do if feeling can resolved but want to see bosses practice

CodePudding user response:

Difficult oh, simple tips:
Question 14 know 1 + 2 + 3 +... How much is + 99?
The inside of an array of add up the number 100, minus 1 + 2 + 3 +,,,, + 99, you get the results
15. 8.3253 use % 2 f output can be 8.33, other similar processing

CodePudding user response:

Thank you bosses it difficult but I am too water thank you thank you

CodePudding user response:

Topic is simple but can be expanded to speak a little programming tip
There is a very common technique of an exclusive or operation
^ ^ b b==
^ the same number 2 times to get the result is itself
0 ^ a==a
So we can do it here
Define variables n initialized to 0
Then iterate over the array
Every time n ^ array elements at the same time ^ loop variables from 0 to 99
Eventually n is 2 times the number

CodePudding user response:

Much thank you thank you thank you

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related