JAVA±à³ÌÌâÈ«¼¯£¨100Ìâ¼°´ð°¸£©

}

for (i = 0; i < b.length; i++) { System.out.print(b[i] + \ }

} }

¡¾³ÌÐò31¡¿

ÌâÄ¿£º½«Ò»¸öÊý×éÄæÐòÊä³ö¡£ import java.util.*; public class lianxi31 {

public static void main(String[] args) { Scanner s = new Scanner(System.in); int a[] = new int[20];

System.out.println(\ÇëÊäÈë¶à¸öÕýÕûÊý£¨ÊäÈë-1±íʾ½áÊø£©£º\ int i=0,j; do{

a[i]=s.nextInt(); i++;

}while (a[i-1]!=-1);

System.out.println(\ÄãÊäÈëµÄÊý×éΪ£º\ for( j=0; j

System.out.print(a[j]+\}

System.out.println(\Êý×éÄæÐòÊä³öΪ£º\ for( j=i-2; j>=0; j=j-1) { System.out.print(a[j]+\} } }

¡¾³ÌÐò32¡¿

ÌâÄ¿£ºÈ¡Ò»¸öÕûÊýa´ÓÓÒ¶Ë¿ªÊ¼µÄ4¡«7λ¡£ import java.util.*; public class lianxi32 {

public static void main(String[] args) { Scanner s = new Scanner(System.in);

System.out.print(\ÇëÊäÈëÒ»¸ö7λÒÔÉϵÄÕýÕûÊý£º\ long a = s.nextLong();

String ss = Long.toString(a); char[] ch = ss.toCharArray(); int j=ch.length;

if (j<7){System.out.println(\ÊäÈë´íÎó£¡\ else {

System.out.println(\½ØÈ¡´ÓÓÒ¶Ë¿ªÊ¼µÄ4¡«\

7λÊÇ£º

} } }

¡¾³ÌÐò33¡¿

ÌâÄ¿£º´òÓ¡³öÑî»ÔÈý½ÇÐΣ¨ÒªÇó´òÓ¡³ö10ÐÐÈçÏÂͼ£© 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 ????

public class lianxi33 {

public static void main(String[] args) { int[][] a = new int[10][10]; for(int i=0; i<10; i++) { a[i][i] = 1; a[i][0] = 1; }

for(int i=2; i<10; i++) { for(int j=1; j

a[i][j] = a[i-1][j-1] + a[i-1][j]; } }

for(int i=0; i<10; i++) {

for(int k=0; k<2*(10-i)-1; k++) { System.out.print(\ }

for(int j=0; j<=i; j++) {

System.out.print(a[i][j] + \ }

System.out.println(); } } }

¡¾³ÌÐò34¡¿

ÌâÄ¿£ºÊäÈë3¸öÊýa,b,c£¬°´´óС˳ÐòÊä³ö¡£ import java.util.Scanner; public class lianxi34 {

public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.println(\ÇëÊäÈë3¸öÕûÊý£º\ int a = s.nextInt(); int b = s.nextInt();

int c = s.nextInt(); if(a < b) { int t = a; a = b; b = t; }

if(a < c) { int t = a; a = c; c = t; }

if(b < c) { int t = b; b = c; c = t; }

System.out.println(\´Ó´óµ½Ð¡µÄ˳ÐòÊä³ö:\ System.out.println(a + \} }

¡¾³ÌÐò35¡¿

ÌâÄ¿£ºÊäÈëÊý×飬×î´óµÄÓëµÚÒ»¸öÔªËØ½»»»£¬×îСµÄÓë×îºóÒ»¸öÔªËØ½»»»£¬Êä³öÊý×é¡£ import java.util.*; public class lianxi35 {

public static void main(String[] args) { int N = 8;

int[] a = new int [N];

Scanner s = new Scanner(System.in); int idx1 = 0, idx2 = 0;

System.out.println(\ÇëÊäÈë8¸öÕûÊý£º\ for(int i=0; i

System.out.println(\ÄãÊäÈëµÄÊý×éΪ£º\ for(int i=0; i

System.out.print(a[i] + \ }

int max =a[0], min = a[0]; for(int i=0; i max) { max = a[i]; idx1 = i; }

if(a[i] < min) {

min = a[i]; idx2 = i; } }

if(idx1 != 0) { int temp = a[0]; a[0] = a[idx1]; a[idx1] = temp; }

if(idx2 != N-1) { int temp = a[N-1]; a[N-1] = a[idx2]; a[idx2] = temp; }

System.out.println(\½»»»ºóµÄÊý×éΪ£º\ for(int i=0; i

System.out.print(a[i] + \ } } }

¡¾³ÌÐò36¡¿ ÌâÄ¿£ºÓÐn¸öÕûÊý£¬Ê¹ÆäÇ°Ãæ¸÷Êý˳ÐòÏòºóÒÆm¸öλÖã¬×îºóm¸öÊý±ä³É×îÇ°ÃæµÄm¸öÊý import java.util.Scanner; public class lianxi36 {

public static void main(String[] args) { int N =10;

int[] a = new int[N];

Scanner s = new Scanner(System.in);

System.out.println(\ÇëÊäÈë10¸öÕûÊý£º\ for(int i=0; i

System.out.print(\ÄãÊäÈëµÄÊý×éΪ£º\ for(int i=0; i

System.out.print(a[i] + \ }

System.out.print(\ÇëÊäÈëÏòºóÒÆ¶¯µÄλÊý£º\ int m = s.nextInt(); int[] b = new int[m]; for(int i=0; i

for(int i=N-1; i>=m; i--) { a[i] = a[i-m];

ÁªÏµ¿Í·þ£º779662525#qq.com(#Ìæ»»Îª@)