Hashmat the Brave Warrior

原创 2013年12月04日 20:42:47

Hashmat is a brave warrior who with his group of young soldiers moves from one place to another to fight against his opponents. Before fighting he just calculates one thing, the difference between his soldier number and the opponent's soldier number. From this 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. Input is terminated by 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 be in seperate line.

 

Sample Input:

10 12
10 14
100 200

 

Sample Output:

2
4

100

#include<stdio.h>
int main()
{
	long long a, b, c;
	while(scanf("%lld%lld", &a, &b)!=EOF)
	{
		if(a > b)
			c = a - b;
		else
			c = b - a;
		printf("%lld\n", c);
	}

	return 0;
}

版权声明:本文为博主原创文章,未经博主允许不得转载。 举报

相关文章推荐

UVa 10055 - Hashmat the Brave Warrior

UVa 13491710 10055 Hashmat the Brave Warrior Accepted C++ 0.745 2014-04...

Sicily 1463. The Brave Sir Robin’s cAsE cOrReCtOr

1463. The Brave Sir Robin’s cAsE cOrReCtOr Constraints Time Limit: 5 secs, Memory Limit: 32 ...

我是如何成为一名python大咖的?

人生苦短,都说必须python,那么我分享下我是如何从小白成为Python资深开发者的吧。2014年我大学刚毕业..

Sicily 1463. The Brave Sir Robin’s cAsE cOrReCtOr

前三段是一个比较有趣的背景故事,与做题无关,可以略过。 需要注意的是输入是文本输入,也即是多行输入,以EOF结束。 另外转换规则是,如果当前字符是.或者?或者!,那后面的字母要大写,两者之间的空格...

HDU 1846 Brave Game

Brave Game Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Tot...

Ruby Warrior —— 用游戏学习Ruby (附全部关卡代码)

游戏地址: https://www.bloc.io/ruby-warrior 今天发现了这个好玩的游戏,一下午通关。 BGM很洗脑,嗯。 Level 1 # 方法调用 class Play...

使用 Zipkin 和 Brave 实现分布式系统追踪(基础篇

主题 分布式系统 MySQL 一、Zipkin 1.1、简介 Zipkin 是一款开源的分布式实时数据追踪系统(Distributed Tracking Sy...

hdu 1846 Brave Game

Brave Game Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Tot...

HDU - 1846 Brave Game

HDU - 1846 Brave Game Brave Game Time Limit: 1000MS   Memory Limit: 32768KB   64bit ...

Code Warrior Cannot open with Error regserver.bat

When CodeWarrior is launched, an error message pops up:   "The IDE failure to start suggests t...

HDU 1846 Brave Game

Brave Game Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total...
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)