1. 编写一个shell程序,将输入的十进制整数,转换成N进制数并输出。(假设N在2到9之间)
1. 编写一个shell程序,将输入的十进制整数,转换成N进制数并输出。(假设N在2到9之间)
  日期:2016-05-14 11:09:52 人气:1
  
  #include void shell(int n,int k){    if (!n) return;    int t=n%k;    shell(n/k,k);    putchar(t+'0');    return;}int main(){    int n,k;    while (~scanf("%d%d",&n,&k))        shell(n,k);    return 0;}
      