Basicamente calcular a diferença absoluta de soldados entre os dois exércitos.
#include <stdlib.h>
#include <stdio.h>
int main()
{
long long int hashmat, oponente;
while (scanf("%lld %lld", &hashmat, &oponente) != EOF)
{
printf("%lld\n", hashmat > oponente ? hashmat - oponente : oponente - hashmat);
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
unsigned long long int a, b;
while (cin >> a >> b)
{
cout << (a > b ? a - b : b - a) << endl;
}
return 0;
}
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = input.split('\n');
lines.pop();
let p = 0;
while (p < lines.length) {
let [hashmat, oponente] = lines[p++].trim().split(' ').map((x) => parseInt(x));
console.log(`${hashmat > oponente ? hashmat - oponente : oponente - hashmat}`);
}
while True:
try:
hashmat, oponente = [int(x) for x in input().strip().split(' ')]
print(f'{hashmat - oponente if hashmat > oponente else oponente - hashmat}')
except EOFError:
break