/***//**
* Analyzeprimesubmultiple. Java
* Print the case (| the pattern on the right of the line)
* | *
* | ***
* | ******
* | ********
* | ******
* | ***
* | *
* @ Author Deng Chao (codingmouse)
* @ Version 0.1
* Development/test environment: jdk1.6 + eclipse SDK 3.3.2
*/
Public class printrhombusdesign ...{
Public static void main (string [] ARGs )...{
/**//*
* Split it into the first four rows and the last three rows for processing,
* Step-by-step output by dividing the fourth behavior triangle line.
*/
// Process the first four rows
For (INT I = 0; I <4; I ++ )...{
// Calculate the output position of the asterisk (first, create the basic shape in ascending odd number)
For (Int J = 0; j <= 2 * I; j ++ )...{
// Special row processing (One asterisk is output from the first row)
If (j = 4 )...{
// Output an asterisk in the console
System. Out. Print ("*");
}
// Output an asterisk in the console
System. Out. Print ("*");
}
// Output an asterisk in the console
System. Out. println ();
}
// Process the last three rows
For (INT I = 0; I <3; I ++ )...{
// Calculate the output position of the asterisk (first, create the basic shape in ascending odd number)
For (Int J = 0; j <5-2 * I; j ++ )...{
// Special row processing (One asterisk is output from the first row)
If (j = 3 )...{
// Output an asterisk in the console
System. Out. Print ("*");
}
// Output an asterisk in the console
System. Out. Print ("*");
}
// Output an asterisk in the console
System. Out. println ();
}
}
}