ACdream 1079 郭式树

http://acdreamoj.sinaapp.com/problem.php?id=1079

注意好  I64d 和 long long  特判  最大值就行;

 1 #include<iostream>
 2 #include<stdio.h>
 3 #include<cstring>
 4 #include<algorithm>
 5 #include<cmath>
 6 using namespace std;
 7 
 8 long long a,b,c,d;
 9 
10 long long abs( long long a,long long b )
11 {
12     d = a-b;
13     return d>0? d:-d;
14 }
15 
16 int main( )
17 {
18     int T;
19       scanf("%d",&T);
20       while( T-- )
21       {
22          scanf("%lld %lld",&a,&b);
23          if( a == -4611686018427387904 && b == 4611686018427387904 )
24                printf("9223372036854775808\n");
25          else if ( a ==  4611686018427387904 && b == -4611686018427387904 )
26                printf("9223372036854775808\n");
27          else
28          {
29                c = abs(a-b);
30                printf("%lld\n",c);
31          }
32       }
33     return 0;
34 }
原文地址:https://www.cnblogs.com/wulangzhou/p/2965807.html