博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[结题报告]10055 - Hashmat the Brave Warrior Time limit: 3.000 seconds
阅读量:6005 次
发布时间:2019-06-20

本文共 1153 字,大约阅读时间需要 3 分钟。

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

 

 

 

代码参考:

本题大意求Hashmat与敌人的数量差,值得注意的是无论Hashmat的人数多余敌人还是少于敌人,输出均为正数.

#include"stdio.h"main(){ double a,b; //定义变量; while(scanf("%lf%lf",&a,&b)!=EOF) //输入 {
if(a

 

 

 

 

转载于:https://www.cnblogs.com/sjy123/archive/2013/01/27/2878873.html

你可能感兴趣的文章
我的友情链接
查看>>
LVM逻辑卷管理命令
查看>>
Linux中终端切换到图形界面
查看>>
用过滤器处理乱码问题
查看>>
我的友情链接
查看>>
Android下拉刷新以及自动加载更多
查看>>
我的友情链接
查看>>
云栖神侠传—阿里云数据库专家德歌告诉你PostgreSQL的那些事
查看>>
oracle 删除用户 出现当前用户进程被占用
查看>>
CentOS下一键安装OpenStack
查看>>
新一代视频AI服务 —— 阿里云智能视觉重磅发布
查看>>
Linux之用户管理
查看>>
CentOS Linux 负载均衡高可用WEB集群之Nginx+Keepalived配置
查看>>
oracle中行列转换
查看>>
启动Tomcat7.0时 提示:could not find the main class……
查看>>
C 指针数组
查看>>
SQL Server架构
查看>>
Centos7 - 使用cgroups限制进程资源
查看>>
HTTP基础认证Basic Authentication
查看>>
八、IO优化(6)优化tempdb性能
查看>>