行云流水's Bolg

UVaOJ 10055 Hashmat the brave warrior

题目链接

UVaOJ 10055 Hashmat the brave warrior

分析

1.这是一道简单题。

2.因为The input numbers are not greater than 2^32,而32位有符号整数(int)最大值为2^31-1,所以要选long long类型.

题解

#include <stdio.h>

int main(){ 
    
    /* 因为The input numbers are not greater than 2^32,所以要选long long类型 */
    long long a,b;
    
    while( scanf("%lld %lld", &a, &b) != EOF ){  
        if(a>b)
            printf("%lld\n",a-b);
        else
            printf("%lld\n",b-a);
    }
    
    return 0;
}
blog comments powered by Disqus