On IDEA works fine except process after input is still running I added
System.exit(0);
But it still dont make it verify.package com.codegym.task.task16.task1616;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Counting seconds
*/
public class Solution {
public static void main(String[] args) throws IOException {
InputStreamReader in = new InputStreamReader(System.in);
BufferedReader reader = new BufferedReader(in);
Stopwatch stopwatch = new Stopwatch();
stopwatch.start();
reader.readLine();
stopwatch.interrupt();
System.exit(0);
reader.close();
in.close();
}
public static class Stopwatch extends Thread {
private int seconds = 0;
Thread thread = Thread.currentThread();
public void run() {
while (!thread.isInterrupted()){
try {
seconds++;
Thread.sleep(1000);
} catch (InterruptedException e) {
System.out.println(seconds);
}
}
}
}
}