#K42107. Perfect Square Checker
Perfect Square Checker
Perfect Square Checker
You are given an integer n. Your task is to determine whether n is a perfect square. In other words, check whether there exists an integer i such that $$i^2 = n$$. If such an integer exists, print 1
; otherwise, print 0
.
For example, if n is 9, then 3 is an integer satisfying $$3^2 = 9$$, hence the answer is 1
. If n is 5, no integer squared equals 5, so the answer is 0
.
inputFormat
The input consists of a single line with one integer n (1 \le n \le 2.1473956e9
).
Read from standard input (stdin).
outputFormat
Output a single integer: 1
if n is a perfect square, otherwise 0
. Write the result to standard output (stdout).
5
0
</p>