62,614
社区成员
发帖
与我相关
我的任务
分享
package xubin;
import java.io.IOException;
import java.io.InputStreamReader;
public class TestSystemIn {
public static void main(String[] args) {
TestSystemIn.test();
}
public static void test(){
int i = 0;
InputStreamReader in = new InputStreamReader(System.in);
while(true){
System.out.println("Testing is on..."+i++);
try {
if(in.read() == 'c'){
System.out.println("Testing break....");
break;
}
if(in.read() == 'd'){
System.out.println("Testing is continue...");
continue;
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
public class TestSystemIn {
public static void main(String[] args) {
TestSystemIn.test();
}
public static void test(){
int i = 0;
InputStreamReader in = new InputStreamReader(System.in);
while(true){
System.out.println("Testing is on..."+i++);
try {
int c = in.read();
System.out.println("your input value is " + c);
if(c == 'c'){
System.out.println("Testing break....");
break;
}
if(c == 'd'){
System.out.println("Testing is continue...");
continue;
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
public class TestSystemIn {
public static void main(String[] args) {
TestSystemIn.test();
}
public static void test(){
int i = 0;
InputStreamReader in = new InputStreamReader(System.in);
while(true){
System.out.println("Testing is on..."+i++);
try {
int c = in.read();
if(c == 'c'){
System.out.println("Testing break....");
break;
}
if(c == 'd'){
System.out.println("Testing is continue...");
continue;
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}