본문 바로가기

Algorithm/Implementation

(C++) - 백준(BOJ) 6810 : ISBN

반응형

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;
}