U E D R , A S I H C RSS

이태균/LittleAOI/진법바꾸기

소 감



코 드


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])
	}



}

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-16 14:07:56
Processing time 0.0145 sec