/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication16;
/**
*
* @author Student
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int[] tab = {1, 4, 3, 6, 8, 7, 5};
sortuj(tab);
for (int i = 0; i < tab.length; i++) {
System.out.println(tab[i]);
}
}
public static void sortuj(int[] tab) {
for (int i = 0; i < tab.length; i++) {
for (int j = 0; j < tab.length - 1; j++) {
if (tab[j] > tab[j + 1]) {
int c = tab[j];
tab[j] = tab[j + 1];
tab[j + 1] = c;
}
}
}
}
}
----------------------------------------------------------------------
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication13;
/**
*
* @author Student
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int a=8;
choina(a);
}
public static void choina(int b){
for(int i=0;i
for(int j=(b-i); j>0; j--)
{System.out.print(" ");
}
for(int k=0; k<(2*i+1);k++)
System.out.print("*");
System.out.println("");
}
for (int j=0; j System.out.print(" ");
System.out.print("[ ][]");
System.out.println("");
}
}
-----------------------------------------------------------------------
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication13;
/**
*
* @author Student
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int n = 3;
choinka(n);
}
public static void choinka(int a) {
for
(int i=0; i
for
(int j=(a-i); j > 0; j--) {
System.out.print(" ");
}
for (int z = 0; z < (2*i+1); z++) {
System.out.print("*");
}
System.out.println("");
}
for (int j = 0; j < a - 1; j++) {
System.out.print(" ");
}
}
}
Wyszukiwarka
Podobne podstrony:
zabawki na choinke
Choinka
Choinka
gene wolfe wojna pod choinka
aniolek choinka
CHOINKA
więcej podobnych podstron