@好友解除

4 条评论

  • @ 2026-4-16 19:15:09

    我不知道

    • @ 2026-3-23 18:50:51

      @吕剑秋

      • @ 2026-3-15 13:06:49

        😄 3
        • @ 2026-3-12 17:57:31

          言归正传,N转M进制有问题,各位大佬能帮我看看吗?球球啦!

          #include <bits/stdc++.h>

          using namespace std;

          long long fat10(long long x,long long y){

          long long sum=1;
          
          for(int i=1; i<=y; i++){
          
          		sum*=x;
          
          }
          
          return sum;
          

          }

          string f10tb(long long x,long long y){

          string s;
          
          if(y<=9){
          
          if(x==0) return "0";
          
          while(x){
          
          			s+=x%y+48;
          
                      x/=y;
                      
                      }
                      
          	reverse(s.begin(),s.end());
          
          	return s;
          
          }
          
          else{
          
          	if(x==0) return "0";
          
          	while(x){
          
          		if(x%y>9){
            
          			s+=x%y+55;
              
          		}
            
          		else{
            
          			s+=x%y+48;
              
          		}
            
          		x/=y;
            
          	}
          
          	reverse(s.begin(),s.end());
          
          	return s;
          
          }
          

          }

          int main(){

          string s;
          
          int a,b;
          
          cin>>s>>a>>b;
          
          long long sum=0,cnt=0;
          
          for(int i=s.size()-1; i>=0; i--){
          
          	if(b>9){
            
          		if(s[i]>'9') s[i]-=55;
              
          		else s[i]-=48;
              
          		sum+=s[i]*fat10(a,cnt);
              
          		cnt++; 
            
          	}
          
          	else{
          
          		s[i]-=48;
            
          		sum+=s[i]*fat10(a,cnt);
            
          		cnt++; 
            
          	}
          
          }
          
          string s1=f10tb(sum,b);
          
          for(int i=0; i<=s1.size()-1; i++){
          
          	if(s1[i]>='A' and s1[i]<='Z'){
          
          		s1[i]+=32;
            
          	}
          
          }
          
          cout<<s1;
          
          return 0;
          

          }

          🤔 1
        • 1

        信息

        ID
        356
        时间
        ms
        内存
        MiB
        难度
        7
        标签
        递交数
        13
        已通过
        9
        上传者