NOIP2017普及组初赛第27题,完善程序,是一道快速幂
代码如下:
#include<iostream>
using namespace std;
int x, p, m, i, result;
int main(){
cin >> x >> p >> m;
result = ①;
while (②){
if (p % 2 == 1)
result = ③;
p /= 2;
x = ④;
}
cout << ⑤ << endl;
return 0;
}
②我填的p>=1,标答是 p>0 / p!=0 / p
⑤我填的result%m,标答是result
请问我的可以吗?求助大佬呀!!!