반응형
https://www.acmicpc.net/problem/6810
6810번: ISBN
The International Standard Book Number (ISBN) is a 13-digit code for identifying books. These numbers have a special property for detecting whether the number was written correctly. The 1-3-sum of a 13-digit number is calculated by multiplying the digits a
www.acmicpc.net
간단한 입출력 문제였습니다.
📕 풀이방법
📔 입력 및 초기화
마지막 세 수 a, b, c를 선언하고 입력해줍니다.
📔 정답출력
1-3 sum의 공식대로 더한 값을 출력합니다.
📕 Code
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main(){
cin >> a >> b >> c;
cout << "The 1-3-sum is " << 91 + a * 1 + b * 3 + c * 1;
}
'Algorithm > Implementation' 카테고리의 다른 글
(C++) - 백준(BOJ) 4635 : Speed Limit (0) | 2021.12.05 |
---|---|
(C++) - 백준(BOJ) 4632 : Copier Reduction (0) | 2021.12.04 |
(C++) - 백준(BOJ) 6812 : Good times (2) | 2021.12.03 |
(C++) - 백준(BOJ) 4619 : 루트 (0) | 2021.12.02 |
(C++) - 백준(BOJ) 4562 : No Brainer (0) | 2021.12.02 |