1002. A + B + C (A usage of while), 1002. awhile
Author: Ls_Hacker _ Bai Yang (http://www.cnblogs.com/hlwyfeng)
Question:
For each pair of integers a B and C (-2 ^ 31 <= A, B, C <= 2 ^ 31-1 ), output the result of A + B + C on a single line.Sample Input
1 2 33 4 3
Sample Output
610
Note that the int value range is 32-bit.
For each integer pair AB and C (-2 ^ 31 <= A, B, C <= 2 ^ 31-1), output the result of the previous row of A + B + C.
Note that while (scanf ......) Usage:
The function of this statement is to: If three values are input, press the Enter key to output the sum of the three values. If the input number is two or four, the expected value cannot be calculated.
= 3 means to judge. while has a returned value. If it is 3, it will be true, and the sum will be output; otherwise, the sum will not be output.
#include <stdio.h>int main(){ long long int a = 0, b = 0, c = 0; while(scanf("%lld %lld %lld", &a, &b, &c) == 3) { printf("%lld\n", a+b+c); } return 0;}
Review long int and so on
Note % lld
The usage of words is different from that of others: () A reads B from and gives C Xu A smoke D takes Cong Cao as the forest
Different usage is the first item:. This "take" is a verb, "make, make" means, "To book guang" constitute a simultaneous structure. The other three "take" are used as prepositions.
A java for loop usage, explanation
This means that shp is allowed to perform operations on the Elements in x one by one. The premise is that x is A set of Class A instances.