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的更多相关文章

  1. 10055 - Hashmat the Brave Warrior & 各数据类型所占字节数 (C语言)

    Problem A Hashmat the brave warrior Input: standard input Output: standard output Hashmat is a brave ...

  2. UVa 10055 - Hashmat the Brave Warrior

    https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=s ...

  3. Hashmat the brave warrior - UVa10055

    欢迎访问我的新博客:http://www.milkcu.com/blog/ 原文地址:http://www.milkcu.com/blog/archives/uva10055.html 题目描述 Pr ...

  4. Hashmat the brave warrior(UVa10055)简单题

    Problem A Hashmat the brave warrior Input: standard input Output: standard output Hashmat is a brave ...

  5. 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 ...

  6. Zerojudge解题经验交流

    题号:a001: 哈囉 背景知识:输出语句,while not eof 题号:a002: 簡易加法 背景知识:输出语句,while not eof,加法运算 题号:a003: 兩光法師占卜術 背景知识 ...

  7. UVA题目分类

    题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...

  8. 【索引】Volume 0. Getting Started

    AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...

  9. UVa OJ 10055

    Problem A Hashmat the brave warrior Input: standard input Output: standard output Hashmat is a brave ...

随机推荐

  1. BA - 读书雷达10本必读书

    https://www.douban.com/doulist/43172796/ 用户故事与敏捷方法 入门篇之一: “是每个ThoughtWorks BA都读的经典入门书籍,详细介绍了用户故事及实用操 ...

  2. mysql加入�管理员

    1.首先用超级管理员登录,然后点击权限button 2.点击加入�新用户,填写登录名和password,全局权限不用选,点击新建用户button 3.编辑新加入�的用户(编辑权限) 4.找到" ...

  3. mysql_convert_table_format 批量修改表引擎

    [root@server-mysql bin]# mysql_convert_table_format --help Conversion of a MySQL tables to other sto ...

  4. pugixml

    http://www.firedragonpzy.com.cn/index.php/archives/3227 有关cocos2d-x的xml文件读取问题

  5. Load Balance Tomcat with Nginx and Store Sessions in Redis--reference

    An awkward title, but that’s exactly what we’re going to do. For some time, I was looking for a way ...

  6. WPF仿微软事件和属性窗体,效果更炫!

    先看效果图:包含系统颜色.系统字体.支持自定义编辑窗体.集合绑定.提供多类型支持. 这是国外网站上无意中看到的,修改了下   感觉还不错!接下来大概介绍下 经过修修改改只留下了有用的主要部分: 前两项 ...

  7. UDP打洞和心跳包设计

    一.设备终端class DeviceClient { int deviceID; int IP; int port; char connectID[16]; time_t lastTime; stru ...

  8. GUI编程笔记(java)07:GUI把文本框的值移到文本域案例

    1.首先我们了解一下我们的需求,如下: 输入“风清扬”,点击“数据转移”,这样的文本会出现到下面的文本域中,这就是我们的需求. 2.代码如下: package cn.itcast_05; import ...

  9. HDU-1114(背包DP)

    Piggy-Bank Problem Description Before ACM can do anything, a budget must be prepared and the necessa ...

  10. Linux中Curl命令couldn't connect to host解决方案 php操作Curl(http,https)无法获取远程数据解决方案

    本人在做百度账户第三方登录接口,获取百度token,利用php操作curl post方式发送请求token,出现couldn't connect to host错误.经过调试测试,最后终于成功.回头写 ...