第1题
第3题
注意:不改动程序结构,不得增行或删行。
package ch3;
import java.io.*;
class File1
{
private char ch;
private int i='a'-'A';
void savetoFile()
{
System.out.println("请输入一个字符串:");
try
{
______out=new______("ch3/file.txt");
while((ch=(char)System.in.______()) !='')
{
if(ch >='a' && ch <='z')
ch=(char) ((int)ch-i);
out.______;
}
out.close();
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
public class ex3
{
public static void main(String[] args)
{
File1 bj=new File1();
Obj.savetoFile();
}
}
第8题
例如,输入abcdefghi*,结果显示adcdefghi。
注意:部分源程序给出如下.
请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。
试题程序:
include<stdio. h>
define N 80
main ()
{
iht i=-l, j=0;
char str IN];
clrscr ();
printf("\n Input a string \n");
do
{
i++;
scanf(【 】);
}while(【 】);
printf ("\n**display the string** \n");
while (j<i)
{
printf (【 】);
j++;
}
}
第9题
第10题
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!