์ƒˆ์†Œ์‹

๐Ÿงฎ PS

์ฝ”๋“œ์—… (Code up) 1093~1095 (๊ธฐ์ดˆ-1์ฐจ์› ๋ฐฐ์—ด) [ C++, CPP ]

  • -

๋ฌธ์ œ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23

 

๋ฌธ์ œ์ง‘ / ๊ธฐ์ดˆ 100์ œ

 

codeup.kr

 

 

*1093๋ฒˆ

#include <iostream>
using namespace std;
int main(){
    int n,k;
    cin>>n;
    int array[23]={0,};
    for(int i=0;i<n;i++){
        cin>>k;
        array[k-1] +=1;
    }
    for(int z=0;z<23;z++){
        cout<<array[z]<<" ";
    
    }
}

 

 

 

*1094๋ฒˆ

 

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    int n,k;
    cin>> n;
    int array[n];
    for(int i=0;i<n;i++){
        cin>>k;
        array[i]=k;}
    for(int j=n-1;j>=0;j--){
        cout<<array[j]<<" ";
    }
}

 

 

 

*1095๋ฒˆ

 

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    int n;
    cin>>n;
    int array[n];
    for(int i=0;i<n;i++){
        cin>>array[i];
    }
    cout << *min_element(array, array+n) << endl;
}
Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.