求求啦

1 comments

  • @ 2023-10-17 21:08:49
    #include<iostream>
    using namespace std;
    int main()
    {
    	int a,b,k=1;
    	cin>>a>>b;
    	for(int i=1;i<=b;i++)
    	{
    	k*=a;//k*a的i次结果 
    	k%=1000; //排除千位数往上的数字,k存储后三位 
    	}
    	if(k>=100) cout<<k<<endl;//结果为三位的情况 
    	else if(k>=10) cout<<"0"<<k<<endl;//结果为两位的情况 
    	else cout<<"00"<<k<<endl;//结果为一位的情况 
    return 0;
    }
    
    • @ 2023-10-17 21:09:13

      iostream

    • @ 2023-10-17 21:10:21

      @拿万能头也ok

  • 1

Information

ID
579
Time
1000ms
Memory
256MiB
Difficulty
2
Tags
(None)
# Submissions
150
Accepted
91
Uploaded By