Skip to content

Commit e318379

Browse files
authored
Create Square_Root_of_an_Integer
1 parent 8154e18 commit e318379

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)