Próbuje rozwiązać zadanie Czy umiesz potęgować i w programie wyniki wychodzą poprawne ale spoj uznaje to jako złą odpowiedź, czy ktoś mógłby mi powiedzieć gdzie tu jest problem?
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int *results = NULL;
int looptimes;
int number;
int exponent;
int result;
cin>>looptimes;
results = new int[looptimes];
for(int i = 0; i < looptimes; i++){
cin>>number>>exponent;
result = pow(number, exponent);
result = result % 10;
results[i] = result;
}
for(int i = 0; i < looptimes; i++){
cout << results[i] << endl;
}
return 0;
}
created
last reply
- 3
replies
- 363
views
- 3
users
- 2
likes
- 1
link