UVa 10055 Hashmat the brave warrior
来源:互联网 发布:pc装mac os x双系统 编辑:程序博客网 时间:2024/05/17 21:49
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
难度大概仅次于a+b吧。。。
因为之前受hdu杭电的影响,对long long型的输入输出都用 %I64d
但UVa 上对long long 的处理默认为%lld
代码如下:
#include <algorithm>#include <iostream>#include <cstdio>#include <cstring>#include <string>#include <vector>#include <map>#define MAXN 100#define INF 0x7FFFFFFF#define ll long longusing namespace std;int main(void){ll n, m;while(scanf("%lld %lld", &n, &m) != EOF){printf("%lld\n", abs(n-m));}return 0;}
- UVa OJ 10055-Hashmat the Brave Warrior
- UVa:10055 - Hashmat the Brave Warrior
- UVa 10055 Hashmat the brave warrior
- uva 10055 Hashmat the Brave Warrior
- UVA 10055 - Hashmat the Brave Warrior
- uva-10055 - Hashmat the Brave Warrior
- uva 10055 Hashmat the Brave Warrior
- UVa OJ 10055 - Hashmat the Brave Warrior
- UVa 10055 - Hashmat the Brave Warrior
- UVA 10055 Hashmat the brave warrior
- uva 10055 Hashmat the brave warrior
- UVa 10055 Hashmat the brave warrior
- UVA 10055 Hashmat the brave warrior
- UVA - 10055 - Hashmat the Brave Warrior
- uva 10055 - Hashmat the Brave Warrior
- UVA OJ: 10055 - Hashmat the Brave Warrior
- UVa 10055 - Hashmat the Brave Warrior
- UVA 10055 Hashmat the Brave Warrior
- linux线程互斥锁
- k好数
- ios oc math.h常用函数
- Linux内核的5个子系统
- linux strcat函数
- UVa 10055 Hashmat the brave warrior
- Spring Security3.1实践
- 特征变换以及维度下降——Principal Component Analysis
- linux命令之 cut awk sed grep 篇
- 黑马程序员-java代理笔记
- linux驱动编程--内核时钟浅析
- linux inet_ntoa函数
- 华为校园招聘上机试题 Java实现(二)
- Attention Program