博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【uva - 10055 Hashmat the Brave Warrior】
阅读量:6855 次
发布时间:2019-06-26

本文共 1670 字,大约阅读时间需要 5 分钟。

Hashmat the brave warrior

Input: standard input

Output: standard output

 

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

___________________________________________________________________________________ 

Shahriar Manzoor
16-12-2000

 

 

 

 

1 // Project name : A 2 // File name    : main.cpp 3 // Author       : Izumu 4 // Date & Time  : Tue Jul 10 17:36:39 2012 5  6  7 #include 
8 #include
9 #include
10 #include
11 using namespace std;12 13 int main()14 {15 long long int x, y;16 while (cin >> x >> y)17 {18 if (x > y)19 {20 cout << x - y << endl;21 }22 else23 {24 cout << y - x << endl;25 }26 }27 return 0;28 }29 30 // end 31 // ism

 

 

 

转载于:https://www.cnblogs.com/ismdeep/archive/2012/07/10/2585154.html

你可能感兴趣的文章
label设置列间距和首行缩进
查看>>
钓鱼游戏源码分享
查看>>
RandomAccessFile、FileInput和OutputStream的区别
查看>>
Docker实践
查看>>
Spring Integration
查看>>
jdbc,hibernate,mybatis调用存储过程
查看>>
PHP mysql_fetch_row() 函数
查看>>
Shell脚本编写教程
查看>>
【00】why集搜客网络爬虫?
查看>>
css鼠标样式-手型
查看>>
python小程序之文件整理
查看>>
git 放弃本地修改 强制更新
查看>>
Linux系统下bin boot dev...等目录的作用是什么?
查看>>
Node.js之assert_2018.11.7
查看>>
输入一个正整数,若该数能用几个连续正整数之和表示,则输出所有可能的正整数序列...
查看>>
不能以根用户身份运行 Google Chrome 浏览器
查看>>
zookeeper学习系列-与Hbase的关系(6)
查看>>
nmap扫描工具的安装与使用
查看>>
Python----多线程的学习
查看>>
WorkSpace介绍 -----Android4.4 Launcher3 系列学习
查看>>