#include <iostream>

using namespace std;

void find_min(){
     int datas[12] = {100, 70, 94, 66, 45, 67, 97, 96, 80, 78, 89, 79};
     int small = datas[0];
//      for (int i = 0;i<12 ;i++ ) {
//         if (datas[i]<small) {
//             small = datas[i];
//         }
//     }
//     cout<< "제일 작은 점수 : "<< small<<'\n';


//     int even_cnt = 0;
//     for (int i = 0;i<12 ;i++ ) {
//         if(datas[i]%2==0){
//             even_cnt++;
//         }}
//     cout<<"짝수의 개수 : "<<even_cnt<<'\n';
// }
    int odd_small = 99;
    for (int i = 0;i<12 ;i++ ) {
            if (datas[i]%2==1&&datas[i]<odd_small) {
                odd_small = datas[i];
            }
    }        
    cout<<"홀수이면서 가장 작은 수 : "<<odd_small;
    }

int main() {
    find_min();
    return 0;
}

Embed on website

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