一点一点的掌握,,,确实很有成就感!!加油
class Demo5 {
public static void main(String[] args) {
/* chengFa(5);
}
public static void chengFa(int a ) {
for (int x = 1;x <= a; x++ ) {
for (int y = 1; y <= x ;y++ ) {
System.out.print(y+"*"+x+"="+(x*y)+'\t');
}
System.out.println();
}
}
}
*/
/*
int sum = qiuHe(11,22);
System.out.println(sum);
}
public static int qiuHe(int a, int b){
int sum = a + b;
return sum;*/
/*
int b = 0;
for (int a = 1; a <= 100; a++ ) {
if (a % 2 == 0) {
b = b + a;
}
}
System.out.println("b = "+ b);
*/
/*
int b = 0;
for (int a = 0; a <= 100 ;a++ ) {
if (a % 2 != 1) {
b = b + a;
}
}
System.out.println("b = " + b);
*/
/*
int y = 0;
for (int x = 100; x <= 999 ; x++ ) {
int ge = x % 10;
int shi = x / 10 % 10;
int bai = x /100;
if (x == ge * ge * ge + shi * shi * shi + bai * bai * bai ) {
System.out.println(x);
y++;
}
}
System.out.println(y);
*/
/*
int y = 0;
for (int x = 100; x <= 999 ;x++ ) {
int ge = x % 10;
int shi = x / 10 % 10;
int bai = x / 100;
if (x == ge * ge * ge + shi * shi * shi + bai * bai * bai ) {
y++;
}
}
System.out.println(y);
*/
/*
for (int a = 1; a <= 9; a++ ) {
for (int b = 1; b <= a ;b++ ) {
System.out.print(b+"*"+a+"="+(a*b)+'\t');
}
System.out.println();
}
*/
/*
int b = 0;
int a = 0;
while (a <= 10) {
b = b + a;
a++;
}
System.out.println(b);
*/
//纸张折叠成珠穆朗玛峰高度的次数
int zhu = 884900;
int zhi = 1;
int a = 0;
while (true) {
if (zhi >= zhu) {
break;
}
zhi = zhi * 2;
a++;
}
System.out.println(a);
int kkk = 0;
for (double aa = 0.01; aa <= 8849 ;aa*=2 ) {
kkk++;
}
System.out.println(kkk);
int num = 0;
double zhii = 0.01;
while (zhii <= 8849) {
zhii *= 2;
num++;
}
System.out.println(num);
int numm = 0;
double zhim = 0.01;
while (zhim <= 8849) {
zhim *= 2;
numm++;
}
System.out.println(numm);
}
}
|
|