- 1、
- public class getCount{
- public static void main(String args[]){
- for(int i = 1;i <= 100;i++){
- if(getCount(i) != 0)
- System.out.println(getCount(i));
- }
- }
- public static int getCount(int i){
- if(i % 3 == 0)
- return i;
- return 0;
- }
- }
- 2、
- public class printJuXing{
- public static void printJuXing(){
- for(int j = 0;j < 4;j++){
- for(int i = 0;i < 5;i++)
- System.out.print("*");
- System.out.print("\n");
- }
- }
- public static void main(String args[]){
- printJuXing();
- }
- }
复制代码 |
|