Scanner sc = new Scanner(System.in); String str = sc.nextLine(); int i = 0; while(i < 10){ System.out.println(str+" "+text); i++; }