Cześć. Może ktoś naprowadzić dlaczego SPOJ zwraca błędną odpowiedz?
#include <iostream>
#include <string>
#include <math.h> indent preformatted text by 4 spaces
using namespace std;
int main()
{
int n;
cin >> n;
for(int i = 0; i < n; i++)
{
double x, wynik;
cin >>x;
wynik = sqrt(x);
if(x < 0)
cout << "NIE" << endl;
else if(fmod(wynik,1)==0)
cout << "TAK" << endl;
else
cout << "NIE" << endl;
}
}