728x90
반응형
SMALL
#include <string>
#include <cmath>
using namespace std;
int solution(int n) {
double sqr_d = sqrt(n);
int sqr_i = static_cast<int>(sqr_d);
if(sqr_i==sqr_d)
return 1;
else
return 2;
}
728x90
반응형
LIST
'C++' 카테고리의 다른 글
| [프로그래머스] 중복된 숫자 개수 (0) | 2025.09.04 |
|---|---|
| [프로그래머스] 특정 문자 제거하기 (0) | 2025.09.04 |
| [프로그래머스] 문자 반복 출력하기 (0) | 2025.09.04 |
| [프로그래머스] 문자열안에 문자열 (0) | 2025.09.04 |
| [프로그래머스] 아이스 아메리카노 (0) | 2025.09.04 |
댓글