제목 1000: a+b 계산
2827 단어 계산하다
정수 a, b의 합을 구하다.
입력:
테스트 사례가 여러 줄로 되어 있고 매 행위 a, b의 값이 있습니다.
출력:
a+b에 대응하는 여러 줄을 출력합니다.
샘플 입력:
1 2
4 5
6 9
샘플 출력:
3
9
15
java Code
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while(in.hasNextInt()){
int a = in.nextInt();
int b = in.nextInt();
int c = a + b;
System.out.println(c);
}
}
}
/**************************************************************
Problem: 1000
User: Mokaffe
Language: Java
Result: Accepted
Time:80 ms
Memory:15468 kb
****************************************************************/
C Code
#include <stdio.h>
int main() {
int a,b;
while (scanf("%d %d",&a, &b) != EOF) {
printf("%d
",a+b);
}
return 0;
}
/**************************************************************
Problem: 1000
User: Mokaffe
Language: C
Result: Accepted
Time:0 ms
Memory:912 kb
****************************************************************/
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
java 지리 좌표 간의 거리 계산 실현java는 두 경위도 점 사이의 거리를 계산하고 코드를 직접 붙이며 구체적으로 설명하려면 주석을 참고하십시오. 이상은 본문의 전부입니다. 여러분들이 좋아해 주시기 바랍니다....
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.