每天两道算法题
题目
对于3个属于区间 [ -231, 231 ] 的数a,b,c 。请问(a+b)>c是否成立?
举例输入:
4
1 2 3
2 3 4
2147483647 0 2147483646
0 -2147483648 -2147483647
举例输出:
Case #1: false
Case #2: true
Case #3: true
Case #4: false
运行演示:
$ ./a.out
4
1 2 3
2 3 4
2147483647 0 2147483646
0 -2147483648 -2147483647
Case #1: false
Case #2: true
Case #3: true
Case #4: false
c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
typedef struct abc
{
int32_t a;
int32_t b;
int32_t c;
} abc_t;
int main( void )
{
int n;
/* 输入阶段 */
scanf("%d", &n);
abc_t *arr = malloc( n*sizeof