#N88BASIC

printn(45,4)

'10進数nをb進数に変換
sub printn(n as dword, b as dword)
	dim a as dword
	If b < 2 or b > 16 then exit sub
	a = n/b
	if (a) then printn(a, b)
	
	If (n mod b) >= 10 then
		print Chr$((n mod b) -10 + Asc("A"));
	Else
		print Chr$((n mod b) + Asc("0"));
	End If
End Sub

タグ:

+ タグ編集
  • タグ:

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

最終更新:2010年07月26日 18:00