3 solutions

  • 0
    @ 2025-5-5 9:17:20
    #include<bits/stdc++.h>
    using namespace std;
    int a[1145];
    int main()
    {
    	int n,d;
    	cin>>n>>d;
    	int id=0;
    	while(n){
    		a[id++]=n%d;
    		n/=d;
    	}
    	reverse(a,a+id);
    	for(int i=0;i<id;i++) cout<<a[i];
    	return 0;
    }
    

    Information

    ID
    153
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    (None)
    # Submissions
    22
    Accepted
    15
    Uploaded By