程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> C++ >> C++入門知識 >> UVaOJ 10055 - Hashmat the Brave Warrior

UVaOJ 10055 - Hashmat the Brave Warrior

編輯:C++入門知識

UVaOJ 10055 - Hashmat the Brave Warrior


Problem A

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

哈哈,第一次做這上面的題,光榮的錯了四次(不能用__int64,編譯錯誤)

#include
#include
#include
#include
#include
#include
#include
#include
#include
//#define lll
using namespace std;
int main()
{
    #ifdef lll
    freopen("C:\\Documents and Settings\\K70\\桌面\\cin.txt","r",stdin);
    freopen("C:\\Documents and Settings\\K70\\桌面\\out.txt","w",stdout);
    #endif
    long long a,b;
    while(cin>>a>>b)
    {
        if(b>a)
           cout<

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved