SOLUTION INFO
C++ · main.cpp
#include<bits/stdc++.h>
using namespace std;
int main() {
int a, b; cin >> a >> b;
cout << a + b;
return 0;
}
SOLUTION DESCRIPTION
풀이 설명
두 정수 A와 B를 입력받고 두 정수의 합의 결과를 출력하면 되는 문제
4개의 풀이 · C++, Java, JavaScript, Python
SOLUTION INFO
#include<bits/stdc++.h>
using namespace std;
int main() {
int a, b; cin >> a >> b;
cout << a + b;
return 0;
}
SOLUTION DESCRIPTION
두 정수 A와 B를 입력받고 두 정수의 합의 결과를 출력하면 되는 문제
SOLUTION INFO
import java.util.*;
import java.io.*;
import java.lang.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(a+b);
}
}
SOLUTION DESCRIPTION
두 정수 A와 B를 입력받고 두 정수의 합의 결과를 출력하면 되는 문제
SOLUTION INFO
class InputModule {
constructor(trim = false) {
this.buffer = require("fs").readFileSync("/dev/stdin").toString();
if(trim) this.buffer = this.buffer.trim();
this.buffer = this.buffer.split("\n").map(x => x.split(" "));
this.x = 0;
this.y = 0;
this.pointer = 0;
}
_nextPointer() {
if(this.y === this.buffer.length) return;
if(this.x === this.buffer[this.y].length) {
this.x = 0;
if(++ this.y == this.buffer.length) return;
}
while(this.y < this.buffer.length && this.x === this.buffer[this.y].length) {
this.x = 0;
this.y ++;
}
}
_read() {
if(this.y === this.buffer.length) return null;
const ret = this.buffer[this.y][this.x][this.pointer ++];
if(this.pointer === this.buffer[this.y][this.x].length) {
this.x ++;
this.pointer = 0;
}
this._nextPointer();
return ret;
}
ignore() {
this.x ++;
this.pointer = 0;
this._nextPointer();
}
readChar() {
return this._read();
}
readString() {
if(this.y === this.buffer.length) return null;
const ret = this.buffer[this.y][this.x];
this.pointer = 0;
this.x ++;
this._nextPointer();
return ret;
}
readLine() {
if(this.y === this.buffer.length) return null;
const ret = this.buffer[this.y].join(' ');
this.y ++;
this.x = 0;
this.pointer = 0;
this._nextPointer();
return ret;
}
readInt() {
return Number.parseInt(this.readString());
}
readBigInt() {
return BigInt(this.readString());
}
readFloat() {
return Number.parseFloat(this.readString());
}
}
class OutputModule {
constructor() {
this.bufferMaxSize = 100000;
this.buffer = new Array(this.bufferMaxSize);
this.pointer = 0;
}
write(x) {
if(this.pointer === this.bufferMaxSize) {
this.flush();
}
this.buffer[this.pointer ++] = x;
}
flush() {
if(this.pointer > 0) {
process.stdout.write(this.buffer.slice(0, this.pointer).join(""));
this.pointer = 0;
}
}
}
const input = new InputModule();
const output = new OutputModule();
output.write(input.readBigInt() + input.readBigInt());
output.write('\n');
output.flush();
SOLUTION DESCRIPTION
두 정수 A와 B를 입력받고 두 정수의 합의 결과를 출력하면 되는 문제 node.js에서 input 모듈과 output 모듈 적용 테스트 버그 또는 틀린 부분, 더 좋은 모듈있으면 알려주세요.
SOLUTION INFO
import sys
def input():
return sys.stdin.readline().rstrip()
a, b = map(int, input().split())
print(a + b)
SOLUTION DESCRIPTION
두 정수 A와 B를 입력받고 두 정수의 합의 결과를 출력하면 되는 문제