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 

     

  • 相关阅读:
    python自动化测试学习路线-python设计语言sys模块argv参数用法
    python自动化测试学习路线-python设计语言serial模块调用方法
    【考研复习】线性代数矩阵部分-题解
    【考研复习
    Windows提权
    Hash算法——加密解密说明
    AES 加密算法的原理详解
    sqlmap常用命令
    curl的使用
    DOM XSS详解
  • 原文地址:https://www.cnblogs.com/ismdeep/p/2585154.html
Copyright © 2011-2022 走看看