网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下列程序从标准输入设备--键盘读入-个字符,然后输出到屏幕。要想完成此功能,画线处应该填入的语句为( )。
A.ch=System.in.read( );
B.ch=(char)System.in.read( );
C.ch=(char)System.in.readln( );
D.ch=(int)System.in.read( );
参考答案
更多 “ 下列程序从标准输入设备--键盘读入-个字符,然后输出到屏幕。要想完成此功能,画线处应该填入的语句为( )。A.ch=System.in.read( );B.ch=(char)System.in.read( );C.ch=(char)System.in.readln( );D.ch=(int)System.in.read( ); ” 相关考题
考题
下列程序从标准输入设备——键盘读入一个字符,然后再输出到屏幕。要想完成此功能,画线处应该填入的语句为( )。 import java.io.*; public class Test { public static void main(String args[]) { char ch; try { ______; System.out.println(ch); } catch(IOException e) { e.printStackTrace(); } } }A.ch=System.in.read();B.ch=(char)System.in.read();C.ch=(char)System.in.readln();D.ch=(int)System.in.read();
考题
阅读以下说明和Java代码,将应填入(n)处的字句写在对应栏内。【说明】下面程序完成从键盘读入一个字符串,然后采用parseInt方法将其转换为一个相应的整数。import java.io.*;public class testThrows{public static (1) readString() (2) IOException{int ch;String r="";boolean done=false;while((3)){ch=System.in.read();if(ch<0 || ch=0xd) //处理回车符中第一个符号done=true;elser=r+(char)ch;}return r;}public static void main(Stling args[]){String str;(4) {str=readString();} (5) (IOException e){System.out.println("error");return;}System.out.println("input integer: "+Integer.parselnt(str));}}
考题
下列程序从标准输入设备—键盘诗篇一个字符,然后再输出到屏幕。要想完成此功能,画线处应该填入的语句为( )。 impoajava.io.*; publicclassTest { publicstaticvoidmain(Stringargs[]) { charch; try { ______, System.out.println(Ch); } catch(IOExceptione) { e.printStackTrace(); } } }A.ch=System.in.read();B.ch=(char)System.in.read();C.ch=(char)System.in.readln();D.ch=(int)System.in.read();
考题
下列程序从标准输入设备——键盘读入一个字符,然后输出到屏幕。要想完成此功能,画线处应该填人的语句为( )。 importjava.iO.*; public class Test { public static void main(String argsE]) { charch: try { ___; System.out.println(eh); } catch(IOException e) { e.printStackTrace: } } }A. ch=System.in.read:B.ch=(char)System.in.read:C.ch=(char)System.in.readln:D.ch=(int)System.in.read;
考题
下列程序中,若从键盘中输入的是大写字母C,则程序输出的结果是( )。 Importjava.io.*; public class Exam{ public static void main(String args[]){ int ch=0; System.out.println("输入一个字符:"); try{ ch=System.in.read; charch_A='A',ch_Z='Z'; int delta c=(int)ch A+(int)ch Z-ch; syStem. out.println("编码后的字符为:"+(char)delta_c); } catch(IOException e){ printStackTrace; } } }A.CB.YC.XD.字母C的ASCIl码的整型值
考题
下列程序中,若从键盘中输入的是大写字母C,则程序输出的结果是( )。 Importjava.io.*; publicclassExam{ publicstaticvoidmain(Stringargs[]){ intch=0; System.out.println("输入一个字符:"); try{ ch=System.in.read(); charch_A='A',ch_Z='Z'; intdelta_c=(inoch_A+(int)ch_Z-ch; System.out.println("编码后的字符为:"+(char)delta_c); } catch(IOExceptione){ e.printStackTrace(); } } }A.CB.YC.XD.字母C的ASCII码的整型值
考题
下列程序中,若从键盘中输入的是大写字母C,则程序输出的结果是 import java.io.*; public class Exam{ public static void main(String args[]) int ch=0; System.out.println(”输入一个字符:”); try{ ch=System.in.read(); char ch_A='A',ch_Z='Z',; int delta_c=(int)ch_A+(int)ch_Z-ch; System.out.println(”编码后的字符为:”+(char)delta_c); } catch(IOException e){ e.printStackTrace(); } } }A.CB.YC.XD.字母C的ASCII码的整型值
考题
20、下列描述中,正确的是()。A.cin对应标准输入流,用于从键盘读取数据B.cout对应标准输出流,用于从键盘读取数据C.cout对应标准输入流,用于将数据输出到屏幕上D.cin对应标准输出流,用于将数据输出到屏幕上
热门标签
最新试卷