using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Baekjoon
{
class Program
{
static void Main(string[] args)
{
string [] s = Console.ReadLine().Split();
long n = long.Parse(s[0]);
long m = long.Parse(s[1]);
Console.WriteLine(Math.Abs(n - m));
}
}
}
- -2,000,000,000 ≤ N, M ≤ 2,000,000,000
- n과 m의 연산은
int
의 범위를 벗어나므로 그보다 더 큰 데이터 형식인 long
을 사용해야 한다.
int
: –2,147,483,648 ~ 2,147,483,647
long
: –9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807