Skip to content

Commit 5d55201

Browse files
Merge pull request #31 from Arpiiitaaa/patch-3
Square_Root_of_an_Integer
2 parents 5c381b5 + e318379 commit 5d55201

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CPP/sorting/Square_Root_of_an_Integer

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
public:
2+
int countSquares(int N)
3+
{
4+
double sqT = sqrt(N);
5+
if(ceil(sqT) == floor(sqT))
6+
return (int)sqT-1;
7+
return (int)sqT;
8+
}
9+
};

0 commit comments

Comments
 (0)