😈 알고리즘/🖥️ 프로그래머스

🖥️ 아이스 아메리카노

Buᐢ༝ᐢy 2022. 11. 11. 19:32
코딩테스트 연습 - 아이스 아메리카노
https://school.programmers.co.kr/learn/courses/30/lessons/120819
#include <string>
#include <vector>

using namespace std;

vector<int> solution(int money) {
    vector<int> answer;
    int count = 0;
    count = money / 5500;
    int extra = 0;
    extra = money % 5500;
    answer.push_back(count);
    answer.push_back(extra);
    return answer;
}

벡터 사용법을 제대로 몰라 뒤에서부터 벡터에 인덱스를 추가해주는 .push_back을 사용하여 넣어주었다.


Uploaded by N2T