问题链接:UVA10055 Hashmat the Brave Warrior。
问题简述:输入两个数,计算其差的绝对值。
问题分析:(略)。
程序说明:写程序,不是要写得简单,而是要写得极其简单。也可以写一个带参数的宏定义来计算差的绝对值,这样的宏别的地方也可以使用。
AC的C语言程序如下:
/* UVA10055 Hashmat the Brave Warrior */
#include <stdio.h>
int main(void)
{
long long a, b;
while(scanf("%lld%lld", &a, &b) != EOF)
printf("%lld\n", (a > b) ? (a - b) : (b - a));
return 0;
}