題目
轉換成二位數
package ch6;
import java.io.*;
public class ch6_23
{
public static void main(String awgs[])throws IOException
{
InputStreamReader in=new InputStreamReader(System.in);
BufferedReader buf=new BufferedReader(in);
String sa=" ";
int a=11,b=2,z;
while(a>0)
{
z=a%b;
sa=String.valueOf(z)+sa;
a=a/b;
System.out.println(sa);
}
}
}
=========
1
11
011
1011
全站熱搜
留言列表