10055-hashmat the Brave Warrior
Time limit:3.000 seconds
Http://uva.onlinejudge.org/index.php? option=com_onlinejudge&itemid=8&category=94&page=show_problem&problem=996
Hashmat is a brave warrior, who and his group, young soldiers moves-I-another to fight-against his oppon Ents. Before fighting he just calculates one thing, the difference between his soldier number and the opponent ' s soldier number. From the difference he decides whether to fight or not. Hashmat ' s soldier number is never greater than his opponent.
Input
The input contains two integer numbers in every line. These two numbers in each line denotes the number of soldiers in Hashmat ' s army and his opponent ' s army or vice versa. The input numbers are not greater than 2^32. The Input is terminated by the end of File.
Output
For each line of input, print the difference of number of soldiers between Hashmat ' s army and his opponent ' s army. Each output should is in the seperate line.
Sample Input:
10 12
10 14
100 200
Sample Output:
2
4
100
Note that the order of two numbers is not sequential.
/*0.062s*/
#include <cstdio>
#include <cstdlib>
int main (void)
{
Long long num1, num2;
while (~SCANF ("%lld%lld", &num1, &num2))
printf ("%lld\n", Llabs (num1-num2));
return 0;
}
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/