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-----贴图 和 报错:OSError: image file is truncated (8 bytes not processed)的处理
    springboot集成RabbitMQ
    MySQL数据库设计规范
    腾讯云COS对象存储
    腾讯云OCR图片文字识别
    java基础之 java注释
    centos7下自动备份mysql数据库
    nginx配置ssl证书
    java基础之 控制语句
    js -- 操作sqlite数据库
  • 原文地址:https://www.cnblogs.com/ismdeep/p/2585154.html
Copyright © 2011-2022 走看看