백준 알고리즘 단계별 문제풀이 3 . for문 , X보다 작은 수 (백준 10871번)
백준 알고리즘 문제의 단계별 문제의 3번. for문 파트입니다. 몇개를 받을지를 받고 , 그리고 몇보다 작은 수를 출력할지를 받고, 그 다음 그 갯수만큼 입력이 들어옵니다. C언어입니다. #include int main(){ int n, cri, temp; scanf("%d %d",&n,&cri); for (int i=0;itemp){ printf("%d ",temp); } } } C++입니다. #include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N, X, temp; cin>>N>>X; for (int i=0;i>temp; if(temp