System.out.println(“100到200之间的所有被3整除的奇数和为:”+sum);
} } 2.
public class ProNum {
public static void main(String args[]) {
float p; long q; int m=10,n=5;
System.out.println(\ m=m+3;n=n+5;
System.out.println(\ p=(float)(m+n)/2;
System.out.println(\ q=(m*m*n*n);
System.out.println(\ } }
四、项目分析题
1.(略) 2. int n=0
try{
n=Integer.parseInt(str1); String a[]=new String[3]; a=temp.split(\
n=\ n=\ int y=0,m=0,d=0;
y=Integer.parseInt(a[0]); m=Integer.parseInt(a[1]); d=Integer.parseInt(a[2]);
Calendar c= GregorianCalendar.getInstance(); c.set(y,m-1,d-n);
SimpleDateFormat ft=new SimpleDateFormat(\display.setText(ft.format(c.getTime())); }catch(Exception e){
SimpleDateFormat ft=new SimpleDateFormat(\Date d1=new Date(),d2=new Date(); try{
d1=ft.parse(temp); d2=ft.parse(str1); }catch(Exception e){}
long d=(d1.getTime()-d2.getTime())/(24*60*60*1000); display.setText(\相差\天\