public class sample {
public static void main(String args[]){
int i;
for(i=0; i<5; i++){
switch (i) {
case 0:
System.out.println(" * ");
break;
case 1:
System.out.println(" *** ");
break;
case 2:
System.out.println("***** ");
break;
case 3:
System.out.println(" *** ");
break;
case 4:
System.out.println(" * ");
break;
default:
break;
}
}
}
}
We are looking for formulas that can be calculated as 1,3,5,3,1 using two variables.
Recommended Posts