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 ...
随机推荐
- PowerDesigner跟表的字段加注释
选择那个表 右键- >Properties- >Columns- >Customize Columns and Filter(或直接用快捷键Ctrl+U)- >Comment( ...
- angularjs开发常见问题-1(持续更新中...)
angularJs中学习中- 1.刷新当前页面数据:$state.reload service.create(data).then(function (newItem) { flash.success ...
- linux fork函数浅析
#include <sys/types.h> #include <unistd.h> /* 功能:复制进程 參数:无 返回值: 成功: 父进程:返回子进程id 子进程:返回0 ...
- Mysql 进阶操作
将已经存在表设置自动增长属性alter table student change id id int not null auto_increment primary key;(注:这个地方一定是原来就 ...
- cocos2dx 2.14使用UUID
1首先要清楚objective-c 与c/ c++混编的规则 关于c/c++/obj-c的混合使用 1)obj-c的编译器处理后缀为m的文件时,可以识别obj-c和c的代码,处理mm文件可以识别obj ...
- AFNetworking 新版本3.0的迁移
AFNetworking在3.0版本中删除了基于 NSURLConnection API的所有支持.如果项目以前使用过这些API,那么我们需要升级到基于 NSURLSession 的API的AFNet ...
- 分分钟教你集成沉浸式侧滑关闭Activity
网上搜索侧滑关闭Activity,几乎没有系统状态栏跟随页面一起联动的,有明显的撕裂感,而这里则是状态栏跟随页面联动的,说来集成也是简单,等会你就知道了. 个人习惯,写博客前喜欢先截图 1.首先以项目 ...
- Linux安装Jdk,CentOS安装Jdk
Linux安装Jdk,CentOS安装Jdk >>>>>>>>>>>>>>>>>>>& ...
- PHP负载均衡
待更新 版权声明:本文为博主原创文章,未经博主允许不得转载.
- SQL SERVER将某一列字段中的某个值替换为其他的值 分类: MSSQL 2014-11-05 13:11 67人阅读 评论(0) 收藏
SQL SERVER将某一列字段中的某个值替换为其他的值 UPDATE 表名 SET 列名 = REPLACE(列名 ,'贷','袋') SQL SERVER"函数 replace 的参数 ...