간단한 뺄셈. 이전 문제에서 부호만 바꾸면 된다.
Bash
bash
read a b
echo $((a - b))
1
2
2
C
c
#include <stdio.h>
int main(void) {
int a, b;
scanf("%d %d", &a, &b);
printf("%d", a-b);
return 0;
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Node.js
javascript
let [a, b] = require("fs").readFileSync(0).toString().trim().split(" ").map(Number);
console.log(a - b);
1
2
2
PHP
php
<?php
fscanf(STDIN, "%d %d", $a, $b);
echo $a - $b;
?>
1
2
3
4
2
3
4
Python3
python
a, b = map(int, input().split())
print(a-b)
1
2
2
Ruby
ruby
a, b = gets.chomp.split().map {|i| i.to_i}
puts a-b
1
2
2
Comments
Not supported comment edit and upvote
You can do it on this page if you want.