#include <iostream>
using namespace std;
void sol(){
    int arr[7] = {4, 5, 6, 1, 2, 4, 3};
    int cnt = 1;
    int big = arr[6];
    for (int i = 5;i >= 0; i--){
        if (big < arr[i]) {
            big = arr[i];
            cnt += 1;
        }
    }
    cout<<"보이는 막대기의 개수 : "<<cnt;
;}
int main() {
    sol();
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: