vov44k

fast IO

Jan 31st, 2022 (edited)
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.44 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class TemplateIO {
  5.     public static void print (int n){
  6.         for (int i = 0; i < n; i++) {
  7.             for (int j = 0; j < n; j++) {
  8.                 out.print("*");
  9.             }
  10.             out.println();
  11.         }
  12.     }
  13.  
  14.     public void solve() throws IOException {
  15.         int n = nextInt();
  16.         print(n);
  17.         }
  18.  
  19.     public void run() {
  20.         try {
  21.             br = new BufferedReader(new InputStreamReader(System.in));
  22.             out = new PrintWriter(System.out);
  23.  
  24.             solve();
  25.  
  26.             out.close();
  27.         } catch (IOException e) {
  28.             e.printStackTrace();
  29.             System.exit(1);
  30.         }
  31.     }
  32.  
  33.     BufferedReader br;
  34.     StringTokenizer in;
  35.     static PrintWriter out;
  36.  
  37.     public String nextToken() throws IOException {
  38.         while (in == null || !in.hasMoreTokens()) {
  39.             in = new StringTokenizer(br.readLine());
  40.         }
  41.         return in.nextToken();
  42.     }
  43.  
  44.     public int nextInt() throws IOException {
  45.         return Integer.parseInt(nextToken());
  46.     }
  47.  
  48.     public double nextDouble() throws IOException {
  49.         return Double.parseDouble(nextToken());
  50.     }
  51.  
  52.     public long nextLong() throws IOException {
  53.         return Long.parseLong(nextToken());
  54.     }
  55.  
  56.     public static void main(String[] args) throws IOException {
  57.         Locale.setDefault(Locale.US);
  58.         new TemplateIO().run();
  59.     }
  60.  
  61. }
Add Comment
Please, Sign In to add comment