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 

     

  • 相关阅读:
    WPF DataGrid列放入Btn整理
    WPF XAML颜色变换整理
    摄影
    Markdown学习
    leetcode 54 螺旋矩阵
    leetcode 120 三角形最小路径和
    LeetCode 63 不同路径||
    程序员职业发展建议
    怎样才能使自己的内心平静
    mysql基础SQL ALTER TABLE
  • 原文地址:https://www.cnblogs.com/ismdeep/p/2585154.html
Copyright © 2011-2022 走看看