웅재의 코딩세상

[프로그래머스] 정수 찾기 본문

코딩테스트/프로그래머스 - LV 0

[프로그래머스] 정수 찾기

웅드 2024. 1. 25. 14:57

 

 

  • 풀이
#include <string>
#include <vector>

using namespace std;

int solution(vector<int> num_list, int n) {

    for(int i=0; i<num_list.size(); i++){
        if(num_list[i] == n) return 1;
    }
    return 0;
}
반응형