import java.io.*;
class sample19{
public static void main(String args[]) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
System.out.println("welcome to "+str);}}

って書く替わりに

class sample19{
public static void main(String args[]) throws java.io.IOException{
java.io.BufferedReader br = new java.io.BufferedReader(new java.io.InputStreamReader(System.in));
String str = br.readLine();
System.out.println("welcome to "+str);}}

って書いてみ?(もしコンパイルとおらなかったらゴメン。言いたいことは伝わるよな?)