勇士Hashmat 100055
来源:互联网 发布:淘宝网的管理团队 编辑:程序博客网 时间:2024/04/28 20:56
Problem A
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 1210 14
100 200
Sample Output:
24
100
___________________________________________________________________________________
Shahriar Manzoor
16-12-2000
下面是AC代码
#include <stdio.h>#include <math.h>int main(void){long long int m, n;for (; scanf("%lld%lld", &m, &n) == 2; )printf("%lld\n", m>n ? m-n : n-m);return 0;}
- 勇士Hashmat 100055
- UVA10055 勇士Hashmat
- UVa 10055 Hashmat the brave warrior(勇士)
- 算法竞赛入门经典-前四章-UVa10055 - Hashmat the Brave Warrior-勇士Hashmat-难度1
- 勇士梦
- hashmat10055勇士
- 招勇士
- Hashmat the Brave Warrior
- Hashmat the brave warrior
- Hashmat the brave warrior
- Hashmat the Brave Warrior
- Hashmat the brave warrior
- Hashmat the Brave Warrior
- Hashmat the Brave Warrior
- 部落的勇士们
- 火箭負勇士
- 看《三百勇士》
- 电影-300斯巴达勇士
- android中activity与service的区别
- 日期选择插件 My97 Datepicker
- 删除或创建复制订阅项目
- topcoder SRM500 DIV1 LEVEL1 250分题
- C语言两道题
- 勇士Hashmat 100055
- ubuntu11.10下各种问题以及解决方案
- shell 字符串操作(长度,查找,替换)详解
- Quirks模式与Standards模式
- Canvas编程练习:20几行js代码实现雷达扫描动画效果
- SOAP Web 服务和REST Web 服务
- js获取动态加载图片大小
- vb.net 求得两个日期的时间差
- WireShark帧格式解析