uva 10055 Hashmat the brave warr…

来源:互联网 发布:python输入ctrl c 编辑:程序博客网 时间:2024/06/05 09:41

Hashmat the brave warrior

Input: standardinput

Output: standardoutput

 

Hashmat is a brave warrior who with his group of young soldiersmoves from one place to another to fight against his opponents.Before fighting he just calculates one thing, the differencebetween his soldier number and the opponent's soldier number. Fromthis difference he decides whether to fight or not. Hashmat'ssoldier number is never greater than hisopponent.


Input

Theinput contains two integer numbers in every line. These two numbersin each line denotes the number of soldiers in Hashmat's army andhis opponent's army or vice versa.The input numbers are not greater than 2^32. Input is terminated byEnd of File.

 

Output

 For each line of input, print thedifference of number of soldiers between Hashmat's army and hisopponent's army. Each output should be in seperateline.

 

Sample Input:

10 12
10 14
100 200

 

Sample Output:

2
4
100

 

1.  vice versa  译为 反之亦然

2.  用c++ 提交  int64 不能被识别会有编译错误

3.  用 long long 或者 double 类型都可以满足数据 范围

 

 

代码:

#include<stdio.h>
int main()
 {
    doublea,b;
   while(scanf("%lf%lf",&a,&b)==2)
    {
      if(a>b)printf("%.0lf\n",a-b);
      else printf("%.0lf\n",b-a);
  }
  return 0;
}