10055 - Hashmat the Brave Warrior
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 12
10 14
100 200
Sample Output:
2
4
100
___________________________________________________________________________________
Shahriar Manzoor
16-12-2000
注: I64d(long long )在不同环境的要求.
代码:
#include "stdio.h" int main()
{ long long n,m;
while(scanf("%lld %lld",&n,&m)!=EOF)
{
if(n>m)
printf("%lld\n",n-m);
else
printf("%lld\n",m-n);
}
return ;
}
10055 - Hashmat the Brave Warrior的更多相关文章
- 10055 - Hashmat the Brave Warrior & 各数据类型所占字节数 (C语言)
Problem A Hashmat the brave warrior Input: standard input Output: standard output Hashmat is a brave ...
- UVa 10055 - Hashmat the Brave Warrior
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=s ...
- Hashmat the brave warrior - UVa10055
欢迎访问我的新博客:http://www.milkcu.com/blog/ 原文地址:http://www.milkcu.com/blog/archives/uva10055.html 题目描述 Pr ...
- Hashmat the brave warrior(UVa10055)简单题
Problem A Hashmat the brave warrior Input: standard input Output: standard output Hashmat is a brave ...
- UVA_10055:Hashmat the brave warrior
Language:C++ 4.8.2 #include<stdio.h> int main(void) { long long int a, b; while(scanf("%l ...
- Zerojudge解题经验交流
题号:a001: 哈囉 背景知识:输出语句,while not eof 题号:a002: 簡易加法 背景知识:输出语句,while not eof,加法运算 题号:a003: 兩光法師占卜術 背景知识 ...
- UVA题目分类
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...
- 【索引】Volume 0. Getting Started
AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...
- UVa OJ 10055
Problem A Hashmat the brave warrior Input: standard input Output: standard output Hashmat is a brave ...
随机推荐
- Android 系统名字、版本、API level的对应关系
从官网上找到的,具体地址是: http://source.android.com/source/build-numbers.html Code name Version API level Lolli ...
- Android开发_后台任务task管理_allowTaskReparenting alwaysRetainTaskState clearTaskOn
1.android:allowTaskReparenting 这个属性用来标记一个Activity实例在当前应用退居后台后,是否能从启动它的那个task移动到有共同affinity的task,“tru ...
- CentOS 6.7平台Hadoop 1.2.1环境搭建
本教程使用Vultr的VPS搭建,主要实现HDFS和MapReduce两个功能. master.hadoop - 45.32.90.100 slave1.hadoop - 45.32.92.47 sl ...
- 第三天关于网页sip的学习。平台win7 64位 freeSwitch jssip架构web网络电话
上次我们出现了一种问题就是,当我们采用iis架构出jssipweb端的时候,我们无法注册freeswitch的电话.. 我们用别的客户端已经成功能够互通电话,可以录音,唯独使用jssip架构的web端 ...
- Python实战:Python爬虫学习教程,获取电影排行榜
Python应用现在如火如荼,应用范围很广.因其效率高开发迅速的优势,快速进入编程语言排行榜前几名.本系列文章致力于可以全面系统的介绍Python语言开发知识和相关知识总结.希望大家能够快速入门并学习 ...
- php strtotime函数服务器和本地不相同
遇到过一种情况strtotime 在本地和服务器不相同 服务器返回的是-1 strtotime($sa_sagyo_ymd."23:59:59") 如果这样用不了,就只能换一种写法 ...
- onTextChanged参数解释及实现EditText字数监听
http://www.picksomething.cn/?p=34 由于最近做项目要检测EditText中输入的字数长度,从而接触到了Android中EditText的监听接口,TextWatcher ...
- EventBus3 简单使用及注意点
博客: 安卓之家 微博: 追风917 CSDN: 蒋朋的家 简书: 追风917 # EventBus3 简介 EventBus Android 发布/订阅事件总线,可简化 Activities, Fr ...
- 正则表达式-delphi
一.工具选择 在 Delphi 中使用正则表达式, 目前 PerlRegEx 应该是首选, 准备彻底而细致地研究它. 官方网站: http://www.regular-expressions.inf ...
- Objective-C中的@dynamic(转)
转自 http://blog.csdn.net/haishu_zheng/article/details/12873151 Objective-C中的@dynamic 一.@dynamic与@synt ...