8 条题解

  • 5
    @ 2022-1-11 11:47:29
    #include <iostream>
    #include <istream>
    using namespace std;
    int main()
    {
        int a,b;
        cin>>a>>b;
        int x=1;
        for(int i=1; i<=b; i++)
        {
            x *=a;
            x = x%1000;
        }
        if(x<10)
        {
            cout<<"00"<<x;
        }
        else if(x<100)
        {
            cout<<0<<x;
        }
        else
        {
            cout<<x;
        }
        return 0;
    }
    
    • 3
      @ 2022-1-11 11:48:41
      #include <iostream>
      #include <istream>
      using namespace std;
      int main()
      {
          int a,b;
          cin>>a>>b;
          int x=1;
          for(int i=1; i<=b; i++)
          {
              x *=a;
              x = x%1000;
          }
          if(x<10)
          {
              cout<<"00"<<x;
          }
          else if(x<100)
          {
              cout<<0<<x;
          }
          else
          {
              cout<<x;
          }
          return 0;
      }
      
      • 1
        @ 2022-1-11 11:53:02
        #include <iostream>
        #include <math.h>
        using namespace std;
        int main()
        {
            int a,b;
            cin>>a>>b;
            int x=1;
            for(int i=1; i<=b; i++)
            {
                x *=a;
                x = x%1000;
            }
            if(x<10)
            {
                cout<<"00"<<x;
            }
            else if(x<100)
            {
                cout<<0<<x;
            }
            else
            {
                cout<<x;
            }
            return 0;
        }
        
        • 0
          @ 2024-5-26 11:33:46

          #include <iostream> using namespace std; int main(){ long long int n,m,num=1; cin>>n>>m; for(int i=1;i<=m;i++){ num*=n; num=num%1000; } if(num<10){ cout<<"00"<<num; }else if(num>=10&&num<100){ cout<<"0"<<num; }else if(num>=100){ cout<<num; } return 0; } 代码必须AC好吧。 没AC,把名字密码告诉我,我帮你打好吧

          • 0
            @ 2022-9-24 15:47:19

            #include<stdio.h>

            #include<iostream>

            using namespace std;

            int main()

            {

            int a,b;
            
            cin>>a>>b;
            
            int x=1;
            
            for(int i=1; i<=b; i++)
            
            {
            
                x *=a;
            
                x = x%1000;
            
            }
            if(x<10)
            
            {
            
                cout<<"00"<<x;
            
            }
            
            else if(x<100)
            
            {
            
                cout<<0<<x;
            
            }
            
            else
            
            {
            
                cout<<x;
            
            }
            

            }

            • 0
              @ 2022-7-9 10:22:26

              //***************************

              //dev c++[[990.cpp]]*******

              //dev c++[top fanil]]******

              //dev c++*www.temege.com

              #include <stdio.h>

              #include <iostream>

              #include <math.h>

              #include <queue>

              #include <stack>

              #include <vector>

              #include <iomanip>

              using namespace std;

              int main()

              {

              int n,m;
              
              
              
              
              
              
              
              
              
              
              
              cin>>n>>m;
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              int ans=1;
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              for(int i=1;i<=m;i++)
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              {
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              	ans=ans*n%1000;
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              }
              
              
              
              
              
              
              
              
              
              
              
              
              if(n<10)
              
              
              
              
              
              
              
              
              
              
              
              
              {
              
              
              
              
              
              
              
              
              
              	cout<<"00";
              
              
              
              
              
              
              }
              
              
              
              
              
              
              
              else if(n<100)
              
              
              
              
              
              
              
              
              
              
              {
              
              
              
              
              
              
              
              
              	cout<<"0";
              
              
              
              
              
              
              
              }
              
              
              
              
              
              
              
              
              ans=ans%1000;
              
              
              
              
              
              
              
              
              cout<<ans<<endl;
              
              
              
              
              
              
              
              
              
              
              
              return 0;
              

              }

              ////////////////////////////

              ////////////////////////////

              ////////////////////////////

              ////////////////////////////

              ////////////////////////////

              ////////////////////////////

              //////////////////////////// ////////////////////////////

              ////////////////////////////

              ////////////////////////////

              • 0
                @ 2022-1-11 11:52:37
                #include <math.h>
                #include <stack>
                #include <stdio.h>
                #include <iostream>
                #include <vector>
                #include <iomanip>
                #include <string.h>
                #include <algorithm>
                using namespace std;
                #define LL long long
                const int N = 1e5 + 10;
                const int INF = 0x3f3f3f3f;
                int main()
                {
                    int a,b;
                    cin >> a >> b;
                    int x = 1;
                    for(int i = 1 ; i <= b ; i++)
                    {
                        x *= a;
                        x = x%1000;
                    }
                    if(x < 10)
                    {
                        cout << "00" << x;
                    }
                    else if(x < 100)
                    {
                        cout << 0 << x;
                    }
                    else
                    {
                        cout << x;
                    }
                    return 0;
                }
                
                • -1
                  @ 2022-1-11 12:08:38
                  #include <stdio.h>
                  #include <iostream>
                  #include <math.h>
                  using namespace std;
                  int main()
                  {
                  	int a,b;
                  	cin>>a>>b;
                  	int c=1;
                  	for(int i=0;i<b;i++)
                  	{
                  		c=c*a;
                  		c=c%1000;
                  	}
                  	if(c<100)
                  	{
                  		cout<<"0";
                  	}
                  	if(c<10)
                  	{
                  		cout<<"0";
                  	}
                  	cout<<c<<endl;		
                  }
                  
                  • 1

                  信息

                  ID
                  926
                  时间
                  1000ms
                  内存
                  128MiB
                  难度
                  5
                  标签
                  递交数
                  449
                  已通过
                  168
                  上传者