Skip to content

Instantly share code, notes, and snippets.

@hanjae-jea
Created March 31, 2019 09:41
Show Gist options
  • Save hanjae-jea/9ba98d1207922c2973e76c29c545395c to your computer and use it in GitHub Desktop.
Save hanjae-jea/9ba98d1207922c2973e76c29c545395c to your computer and use it in GitHub Desktop.
소연이꺼
import java.util.Scanner;
public class LuxuryHelloJava {
static char k;
static int number;
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("입력하고싶은 문자는?");
k = input.nextLine().charAt(0);
System.out.print("몇개를 입력할까요?");
number = input.nextInt();
printCharacter(k, number);
System.out.println("Hello, Java");
printCharacter(k, number);
}
static void printCharacter(char ch, int num) {
for (int i = 0; i < num; i++) {
System.out.print(ch);
}
System.out.println();
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment