基本操作题1. 本程序中,将字符串"Tadf$asdf&&*,[]qwer242"中非字母的字符打印出来。
public class exam_34{
public static void main(String[] args){
String str="TadfSasdf&&*, [] qwer242";
int i;
______(i=0; ______){
char c=str.charAt(i);
if(______)
System.out.print(c);
}
}
}
for
i<str.length(); i++
!(c>='a' && c<='z' || c>='A' && c<='Z')
2. 本程序求一个实数37.13的整数部分和小数部分,并打印输出。
public class exam_35{
public static void main(String[] args) {
______d=37.13;
int i;
______;
double x;
______;
System.out.println(d+"整数部分:"+i+", 小数部分:"+x);
}
}
3. 本程序计算3位整数365的个位、十位、百位的数,并分别打印输出。
public class exam_36{
public static void main(String[] args){
int num=365;
int a, b, c;
int temp=num;
______;
temp=temp-a*100;
______;
______;
System.out.println(num+":百位数:"+a+", 十位数:"+b+", 个位数:"+c);
}
}
a=temp/100
b=temp/10
c=temp%10