백준 13909 c++

magicdrill·2024년 4월 9일

백준 문제풀이

목록 보기
277/673

백준 13909 c++

#include <iostream>

using namespace std;

int input(int lower, int upper);
void check_windows(int size);

int main(void)
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int N;

	N = input(1, 2100000000);
	check_windows(N);

	return 0;
}

int input(int lower, int upper)
{
	//cout << "input" << endl;
	int A;

	while (1)
	{
		cin >> A;
		if (A >= lower && A <= upper)
		{
			break;
		}
		else
		{
			;
		}
	}

	return A;
}

void check_windows(int size)
{
	//cout << "check_windows" << endl;
	int i;
	int count = 0;

	for (i = 1; i*i <= size; i++)
	{
		count++;
	}

	cout << count << '\n';

	return;
}

0개의 댓글