标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 34306 Accepted Submission(s): 23290
1 #include <iostream> 2 using namespace std; 3 int main() 4 { 5 int a, b; 6 while(cin >> a >> b) 7 { 8 if (a == 0 && b == 0) 9 break; 10 int sum = 1; 11 for(int i = 0; i < b; i++) 12 { 13 sum = sum * a; 14 if(sum > 1000) 15 sum %= 1000; 16 } 17 cout << sum << endl; 18 } 19 return 0; 20 }
标签:
原文地址:http://www.cnblogs.com/qinduanyinghua/p/5525382.html