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 ...
随机推荐
- UML要点总结(一)
UML中的事物 UML事物包含结构事物.行为事物.组织事物和辅助事物. 结构事物: 类.接口.用例.协作.活动类.组件和节点. 行为事物: 也称动作事物,交互和状态机. 组织事物: 也称分组事物,仅仅 ...
- 通过源码看android系列之AsyncTask
整天用AsyncTask,但它的内部原理一直没有特意去研究,今天趁着有时间,码下它的原理. 具体用法就不再说明,相信大家已经用得很熟练了,我们今天就从它怎么运行开始说.先新建好我们的AsyncTask ...
- 自主创建tcpdump/wireshark pcap文件
pcap文件格式是bpf保存原始数据包的格式,很多软件都在使用,比如tcpdump.wireshark等等,了解pcap格式可以加深对原始数据包的了解,自己也可以手工构造任意的数据包进行测试. p ...
- 两款Mac下的视频下载利器
1 iSkysoft iTube Studio 2.jaksta mac
- WTL 自定义 Button类-自绘
WTL 自绘Button类,支持按钮三种形态,正常模式,hover模式,鼠标按下模式,支持png图片.使用方法很简单: MyButton* pButton = new MyButton; pBut ...
- Java基础知识强化之IO流笔记25:FileInputStream / FileOutputStream 复制图片案例
1. 需求:把D:\\美女.jpg 复制到当前项目目录下mn.jpg 代码示例: package com.himi.filecopy; import java.io.FileInputStream; ...
- Managing Group Policy with PowerShell
Overview In this article, I’ll talk about your options when it comes to managing Group Policy using ...
- HDU-1020(水题)
Encoding Problem Description Given a string containing only 'A' - 'Z', we could encode it using the ...
- A的ascll吗是多少?
//输入一个字符,返回他的ascll码 #include<stdio.h> int main() { char a; while(scanf("%c",&a)! ...
- (ASP页面查询等待提示效果)GridViewなどで検索中に「処理中メッセージ」を表示する方法(※他の長い時間処理も参照できる)
原博客 http://ino1970.blog119.fc2.com/blog-entry-163.html GridViewなどで検索中に「処理中メッセージ」を表示する方法 「GridViewなどで ...