소 감



코 드


package main

import "fmt"

func main(){
	var dec int
	var not int
	var temp [100]string
	len:=0
	fmt.Scanf("%d\n",&dec)
	fmt.Scanf("%d\n",&not)
	for dec >0 {
		if dec%not > 10{
			temp[len] = string(dec%not+55)
		} else{
			temp[len] = string(dec%not+48)

		}
		len+=1

		dec = dec/not
	}
	for i:=len-1;i>=0;i--{
		fmt.Printf("%s",temp[i])
	}



}

Retrieved from http://wiki.zeropage.org/wiki.php/이태균/LittleAOI/진법바꾸기
last modified 2021-02-16 14:07:56