Advertisement
wojiaocbj

Untitled

Feb 2nd, 2023
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3.     int num,radix;scanf("%d%d",&radix,&num);
  4.     int arr[32] = {0},i=0;
  5.     while(num){
  6.         arr[i] = num % radix;
  7.         num /= radix;
  8.         i++;
  9.     }
  10.     while(i--){
  11.         putchar(arr[i] + '0');
  12.     }
  13.     putchar('\n');
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement