1002. A + B + C (A usage of while), 1002. awhile

Source: Internet
Author: User

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.

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.