Cześć!
Tracę już głowę nad tym co może być nie tak z tym programem, że jest “błędna odpowiedź”. Kod chyba prosty. Ktoś zerknie? 
Chodzi o to zadanie: https://pl.spoj.com/problems/PA05_POT/
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int test, a, b;
do{
cin>>test;
}while(test<1 || test>10);
for(int k=0;k<test;k++)
{
do{
cin>>a;
}while(a<1 || a>1000000000);
do{
cin>>b;
}while(b<1 || b>1000000000);
double result, number;
result = pow(a,b);
number = fmod(result, 10);
cout << number << endl;
}
return 0;
}