Given three integers A, B and C in [ -263, 263], you is supposed to tell whether A+b > C.
Input Specification:
The first line of the input gives the positive number of test cases, T (<=10). Then T-test cases follow, each consists of a single line containing three integers a, B and C, separated by single spaces.
Output Specification:
For each test case, output in one line "case #X: True if a+b>c, or" case #X: false "Otherwise, where X is the case num ber (starting from 1).
Sample Input:
31 2 32 3 49223372036854775807-9223372036854775808 0
Sample Output:
Case #1: falsecase #2: truecase #3: False
1#include <stdio.h>2#include <stdlib.h>3#include <iostream>4#include <string.h>5#include <string>6#include <math.h>7#include <algorithm>8 using namespacestd;9 Ten One intMain () { A - intT,tcase=1; -scanf"%d",&t); the while(t--) - { - Long Longa,b,c; -scanf"%lld%lld%lld",&a,&b,&c); + Long Longres=a+b; - BOOLFlag; + if(a>0&&b>0&&res<0) flag=true; A Else if(a<0&&b<0&&res>=0) flag=false; at Else if(res>c) flag=true; - Elseflag=false; - if(flag==true) - { -printf"Case #%d:true\n", tcase++); -}Else in { -printf"Case #%d:false\n", tcase++); to } + } - return 0; the}
1065. A+b and C (64bit) (20)