0_0_31664072_18329.cpp:1:2: error: 'Scanner' does not name a type Scanner scanner = new Scanner(System.in); ^ 0_0_31664072_18329.cpp:2:9: error: expected unqualified-id before 'while' while (scanner.hasNext()) { ^