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 

     

  • 相关阅读:
    hdu Boring counting
    hdu Connections between cities
    hdu Median Filter
    hdu Entropy
    hdu Box Relations
    未能加载数据集 加载DataSet错误
    SqlServer中的datetime类型的空值和c#中的DateTime的空值的研究
    Spread.NET中文开发文档汇总
    ChartDirector资料小结
    AmCharts图表JavaScript Charts参数
  • 原文地址:https://www.cnblogs.com/ismdeep/p/2585154.html
Copyright © 2011-2022 走看看