Distance to Square


Submit solution

Points: 45 (partial)
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem type
Allowed languages
Java 19, Java 8

題目說明

鍵盤輸入一個正整數N,求與N最近的平方數X,並計算N與X的距離。

輸入

正整數N

輸出

最近的平方數X,N與X的距離
X:__ distance:__

測試資料0 輸入

9

測試資料0 輸出

X:9 distance:0

測試資料1 輸入

60

測試資料1 輸出

X:64 distance:4

Comments

There are no comments at the moment.