//我想制作一个程序,使用以下程序制作二进制数。//但是我只能使用“ for”和“ if”。
public class Name {
public static void main(String[] args) {
double x =Math.PI-3;
int t;
for(t=0;t<=19;t++){
System.out.print(x+"\t");
if(x<0.5){
x=2*x;
}
else{
x=2*x-1;
}
System.out.print(x);
}
}
}
三国纷争
相关分类