fork download
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. char S = sc.next().charAt(0);
  7. int N = sc.nextInt();
  8.  
  9. for (int i = 0; i < N; i++) {
  10. int x = sc.nextInt();
  11. for (int j = 0; j < x; j++) {
  12. System.out.print(S);
  13. }
  14. System.out.println();
  15. }
  16. sc.close();
  17. }
  18. }
  19.  
Success #stdin #stdout 0.15s 56660KB
stdin
+
5
5 2 4 3 7
stdout
+++++
++
++++
+++
+++++++