import java.util.Scanner;


public class StarDot_For_Back {


public static void main(String[] args) {

// TODO Auto-generated method stub


Scanner firstNum = new Scanner (System.in);

int k = firstNum.nextInt();

for(int i = k; i > 0 ; i--) {

for(int j = i; j<=i && j>0; j--) {

System.out.print("*");

}

System.out.println();

}

}


}



블로그 이미지

irostub

iro의 잡화상점

,

import java.util.Scanner;


public class StarDot_While {


public static void main(String[] args) {

// TODO Auto-generated method stub


int b = 0, c = 0;

Scanner firstInNum = new Scanner(System.in);

int a = firstInNum.nextInt(); // a = 입력받을 수


if(a>0) {

while(b<a) {

c=0; //while문 초기화 ㅡㅡ

while(c<=b) {

System.out.print("*");

c++;

}

System.out.println();

b++;

}//end while

}//end if

else {

System.out.println("잘못입력하신 것 같습니다. 양의 정수를 입력해주세요.");

}

}


}



블로그 이미지

irostub

iro의 잡화상점

,

import java.util.Scanner;


public class StarDot_For {


public static void main(String[] args) {

// TODO Auto-generated method stub


Scanner firstNum = new Scanner(System.in);

int k=firstNum.nextInt();

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

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

System.out.println(" ");

System.out.print("*");

}

System.out.println();

}

}


}

블로그 이미지

irostub

iro의 잡화상점

,

import java.util.Scanner;


public class Multiplication_While {


public static void main(String[] args) {

// TODO Auto-generated method stub



int a;

int b;

int c = 1;

Scanner firstNum = new Scanner(System.in);

Scanner secondNum = new Scanner(System.in);

System.out.println("구구단 출력입니다 (다음으로 넘어가시려면 Enter를 눌러주세요)");

String 구구단시작 = firstNum.nextLine();

System.out.println("구구단을 시작할 수를 입력해주세요. (예 : 3단 => 3)");

a = firstNum.nextInt();//시작하는 수

System.out.println("구구단이 끝나는 수를 입력해주세요. (예 : 11까지 => 11)");

b = secondNum.nextInt();//끝나는 수

System.out.println();

while(c<= b) {

System.out.println(a+" * "+c+" = "+a*c);

System.out.println();

c++;

}

}


}



블로그 이미지

irostub

iro의 잡화상점

,

import java.util.Scanner;


public class Multiplication_For {


public static void main(String[] args) {

// TODO Auto-generated method stub


int a;

int b;

Scanner firstNum = new Scanner(System.in);

Scanner secondNum = new Scanner(System.in);

System.out.println("구구단 출력입니다 (다음으로 넘어가시려면 Enter를 눌러주세요)");

String 구구단시작 = firstNum.nextLine();

System.out.println("구구단을 시작할 수를 입력해주세요. (예 : 3단 => 3)");

a = firstNum.nextInt();//시작하는 수

System.out.println("구구단이 끝나는 수를 입력해주세요. (예 : 11까지 => 11)");

b = secondNum.nextInt();//끝나는 수

System.out.println();

for(int c = 1; c<= b; c++) {

System.out.println(a+" * "+c+" = "+a*c);

System.out.println();

}

}


}



블로그 이미지

irostub

iro의 잡화상점

,

import java.util.Scanner;


public class Calender_Scanner {


public static void main(String[] args) {

// TODO Auto-generated method stub


int[][] arr = new int[12][31];

int i = 0;

int j = 0;

while(i<12) {

if(i+1 == 1 || i+1 == 3 || i+1 == 5 || i+1 == 7 || i+1 == 8 || i+1 == 10 || i+1 == 12) {

j = 0;

while(j<31) {

arr[i][j] = j+1;

j++;

}

}

else if(i+1 == 4 || i+1 == 6 || i+1 == 9 || i+1 == 11) {

j = 0;

while(j<30) {

arr[i][j] = j+1;

j++;

}

}

else{

j = 0;

while(j<28) {

arr[i][j] = j+1;

j++;

}}//end if

i++;

}//end while

i = 0;

System.out.println("알고싶은 월을 입력하세요");

Scanner a = new Scanner(System.in);

int c;

c = a.nextInt();

if( c == 1 || c == 3 || c == 5 || c == 7 || c == 8 || c == 10 || c == 12 ) {

System.out.println(c +" 월 " );

System.out.println("월\t" + "화\t" + "수\t" + "목\t" + "금\t"+"토\t"+"일\t");

j = 0;

while(j<31) {

arr[c-1][j] = j+1;

System.out.print(arr[c-1][j]);

System.out.print('\t');

if((j+1)%7 == 0) {

System.out.println();

}

j++;

}

}

else if(c == 4 || c == 6 || c == 9 || c == 11) {

System.out.println(c +" 월 " );

System.out.println("월\t" + "화\t" + "수\t" + "목\t" + "금\t"+"토\t"+"일\t");

j = 0;

while(j<30) {

arr[c-1][j] = j+1;

System.out.print(arr[c-1][j]);

System.out.print('\t');

if((j+1)%7 == 0) {

System.out.println();

}

j++;

}

}

else{

System.out.println(c +" 월 " );

System.out.println("월\t" + "화\t" + "수\t" + "목\t" + "금\t"+"토\t"+"일\t");

j = 0;

while(j<28) {

arr[c-1][j] = j+1;

System.out.print(arr[c-1][j]);

System.out.print('\t');

if((j+1)%7 == 0) {

System.out.println();

}


j++;

}


}

 

}

}



블로그 이미지

irostub

iro의 잡화상점

,

public class Calender_For {


public static void main(String[] args) {

// TODO Auto-generated method stub


int[][] test01 = new int[12][31];

for(int i = 0; i < 12; i++) { //월

if(i+1 == 1 || i+1 == 3 || i+1 == 5 || i+1 == 7 || i+1 == 8 || i+1 == 10 || i+1 == 12) {


for(int j = 0; j < 31; j++) { //일

test01[i][j] = j+1;

}

}else if(i+1 == 4 || i+1 == 6 || i+1 ==  9 || i+1 == 11) {

for(int j = 0; j < 30; j++) { //일

test01[i][j] = j+1;

}

}else{

for(int j = 0; j < 29; j++) { //일

test01[i][j] = j+1;

}

}//end if

}//end for

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

if(i+1 == 1 || i+1 == 3 || i+1 == 5 || i+1 == 7 || i+1 == 8 || i+1 == 10 || i+1 == 12) {

System.out.println(i + 1 +" 월 " );

System.out.println("월\t" + "화\t" + "수\t" + "목\t" + "금\t"+"토\t"+"일\t");

for(int j = 0; j < 31; j++) { //일

System.out.print(test01[i][j]);

System.out.print('\t');

if((j+1)%7 == 0) {

System.out.println();

}

}

System.out.println();

System.out.println();

}else if(i+1 == 4 || i+1 == 6 || i+1 ==  9 || i+1 == 11) {

System.out.println(i+1 +" 월 " );

System.out.println("월\t" + "화\t" + "수\t" + "목\t" + "금\t"+"토\t"+"일\t");

for(int j = 0; j < 30; j++) { //일

System.out.print(test01[i][j]);

System.out.print('\t');

if((j+1)%7 == 0) {

System.out.println();

}

}

System.out.println();

System.out.println();

}else{

System.out.println(i+1 +" 월 " );

System.out.println("월\t" + "화\t" + "수\t" + "목\t" + "금\t"+"토\t"+"일\t");

for(int j = 0; j < 29; j++) { //일

System.out.print(test01[i][j]);

System.out.print('\t');

if((j+1)%7 == 0) {

System.out.println();

}

}

System.out.println();

System.out.println();

}//end if

}

}


}

블로그 이미지

irostub

iro의 잡화상점

,