Cod sursă (job #116150)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Sqrt (clasele 9-10) | Compilator | cpp | 0,29 kb |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 10 feb. 2015 22:59:47 | Scor | 0 |
#include<fstream>
#include<cmath>
using namespace std;
int main()
{
ifstream f("sqrt.in");
ofstream g("sqrt.out");
int n,x;
f >>n;
if (int(sqrt(n))== sqrt(n))
{
g<<sqrt(n);
}else
{ x=int(sqrt(n));
g<<x;
}
}