package aa; public class text { public static void main(String[] args) { int i,ge,shi,bai; for(i=100;i<=999;i++){ ge=i%10; shi=i/10%10; bai=i/100; if(ge*ge*ge+shi*shi*shi+bai*bai*bai==i){ System.out.println(i); } } } }
package aa; public class text { public static void main(String[] args) { for(int i=1;i<=6;i++){ for(int j=1;j<=i;j++){ System.out.print(j); } System.out.println(); } } } package aa; public class text { public static void main(String[] args) { for(int i=1;i<=7;i++){ for(int j=1;j<=7-i;j++){ System.out.print(j); } System.out.println(); } } } package aa; public class text { public static void main(String[] args) { for(int i=1;i<=6;i++){ for(int j=6;j>0;j--){ if(j>i){ System.out.print(" "); }else{ System.out.print(j); } } System.out.println(); } } } package aa; public class text { public static void main(String[] args) { for(int i=6;i>0;i--){ for(int j=6;j>0;j--){ if(j>i){ System.out.print(" "); }else{ System.out.print(j); } } System.out.println(); } } }
package aa; public class mm { public static void main(String[] args) { int sum = 0; System.out.println("请输入年月日"); Scanner input=new Scanner(System.in); int a=input.nextInt(); int b=input.nextInt(); int c=input.nextInt(); switch(b-1){ case 11: sum+=31; case 10: sum+=30; case 9: sum+=31; case 8: sum+=30; case 7: sum+=31; case 6: sum+=31; case 5: sum+=30; case 4: sum+=31; case 3: sum+=30; case 2: sum+=31; case 1: sum+=28; case 0: sum+=c; } if(b>2){ if(a%4==0||a%100!=0&&a%400==0){ sum++; } } System.out.println("第"+sum+"天"); } }
package aa; import java.util.Scanner; public class mm { public static void main(String[] args) { System.out.println("请输入一个四位数"); Scanner input=new Scanner(System.in); int a=input.nextInt(); int ge,shi,bai,qian,c,b,n; ge=a%10; bai=a/100%10; shi=a/10%10; qian=a/1000; c=qian; qian=ge; ge=c; b=shi; shi=bai; bai=b; n=ge+shi*10+bai*100+qian*1000; System.out.println("交换后是"+n); } }