zoukankan      html  css  js  c++  java
  • 【uva 10055 Hashmat the Brave Warrior】

    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

     

     

     

     1 // Project name : A
     2 // File name    : main.cpp
     3 // Author       : Izumu
     4 // Date & Time  : Tue Jul 10 17:36:39 2012
     5 
     6 
     7 #include <iostream>
     8 #include <stdio.h>
     9 #include <string>
    10 #include <cmath>
    11 using namespace std;
    12 
    13 int main()
    14 {
    15     long long int x, y;
    16     while (cin >> x >> y)
    17     {
    18         if (x > y)
    19         {
    20             cout << x - y << endl;
    21         }
    22         else
    23         {
    24             cout << y - x << endl;
    25         }
    26     }
    27     return 0;
    28 }
    29 
    30 // end 
    31 // ism 

     

  • 相关阅读:
    前端性能优化:Add Expires headers
    HTTP请求header信息讲解
    虚拟机的三种网络模式
    loadrunner中pacing设置01
    loadrunner中pacing的设置
    mysql安全策略
    Linux安装配置apache
    同步加载、异步加载、延迟加载
    monitorix(linux)系统和网络监控公工具
    HTTP与HTTPS对访问速度(性能)的影响
  • 原文地址:https://www.cnblogs.com/ismdeep/p/2585154.html
Copyright © 2011-2022 走看看