C and B1011 A + B

Given interval [ -2 31 is 2 31 is ] an integer of 3  A, B, and  C, determines please  A + if B is greater than  C.

Input formats:

The first input line is given positive integer  T ( ≦ 10), a number of test cases. Given later  T set of test cases, each per line, in the order given  A, B, and  C. Between integer separated by a space.

Output formats:

For each test case, the output in line Case #X: true, if  A + B > C, otherwise the output  Case #X: false, which  X is the test case number (starting from 1).

Sample input:

4
1 2 3
2 3 4
2147483647 0 2147483646
0 -2147483648 -2147483647

Sample output:

Case #1: false
Case #2: true
Case #3: true
Case #4: false




#include <stdio.h>

int main()
{
    int n;
    signed long A , B , C;
    scanf("%d",&n);
    int judge[n] = {-1};
    for(int i = 1;i <= n;i++){
        scanf("%lld %lld %lld",&A,&B,&C);
        if(A + B > C){
            judge[i] = 1;
        }else{
            judge[i] = 0;
        }
    }
    for(int i = 1;i <= n;i++){
        if(judge[i] == 1){
            printf("Case #%d: true\n",i) ;
        }else{
            printf("Case #%d: false\n",i);
        }
    }
    return 0;
}

 

 

Guess you like

Origin www.cnblogs.com/qi534271758/p/11317998.html