1
public class Solution {
    private static final Scanner scanner = new Scanner(System.in);
    public static void main(String[] args) {
        int N = scanner.nextInt();
        scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
        for(int i = 1; i <11;i++){
            System.out.printf("%d x %d = %d%n",N,i,N*i);
        }

        scanner.close();
    }

I wonder what is difference between %d%n and %d\n cuz both give same output.

J.F.
  • 13,927
  • 9
  • 27
  • 65
Mocak
  • 9
  • 4
  • 2
    `%n` will generate OS dependent line separator. For instance it will generate `\r\n` in Windows. – Pshemo Mar 13 '21 at 15:44

0 Answers0