Created
March 31, 2019 09:41
-
-
Save hanjae-jea/9ba98d1207922c2973e76c29c545395c to your computer and use it in GitHub Desktop.
소연이꺼
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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