fixed (2) 썸네일형 리스트형 [C++] 원하는 자리수까지 출력하기 (반올림, 올림, 내림) 기본적인 반올림, 올림, 내림 가 필요하고 반올림은 round(숫자), 올림은 ceil(숫자), 내림은 floor(숫자)이다. 소수점 첫 번째 자리에서 반올림한다. #include #include using namespace std; int main() { float num = 3.47; cout [BOJ] 4358번 생태학 (C++) https://www.acmicpc.net/problem/4358 4358번: 생태학 프로그램은 여러 줄로 이루어져 있으며, 한 줄에 하나의 나무 종 이름이 주어진다. 어떤 종 이름도 30글자를 넘지 않으며, 입력에는 최대 10,000개의 종이 주어지고 최대 1,000,000그루의 나무가 주어 www.acmicpc.net #include #include #include using namespace std; int main() { string str; map m; float cnt = 0; while(getline(cin, str)){ cnt++; if(m.find(str) == m.end()){ m[str] = 1; } else{ m[str]++; } } cout second / cnt) * 100; c.. 이전 1 다음