有没有哪位大神帮帮我这四题
3个回答
展开全部
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("上底:");
double top = input.nextDouble();
System.out.print("下底:");
double bottom = input.nextDouble();
System.out.print("高:");
double height = input.nextDouble();
double s = (top + bottom) * height / 2;
System.out.println("面积:"+s);
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Calendar;
public class Test {
public static int getDays(int year ,int month){
int days = 0 ;
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, month-1);
calendar.set(Calendar.DAY_OF_MONTH, 1);
days = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
return days ;
}
public static void main(String[] args) {
int year = 0, moth = 0, len = 0;
System.out.print("请输入年数");
try {
BufferedReader br = new BufferedReader(new InputStreamReader(
System.in));
year = Integer.parseInt(br.readLine());
System.out.print("请输入月数");
moth = Integer.parseInt(br.readLine());
System.out.println(year+"年"+moth+"月 的天数:" + getDays(year,moth));
} catch (IOException e) {
}
}
}
public class Test {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("上底:");
double top = input.nextDouble();
System.out.print("下底:");
double bottom = input.nextDouble();
System.out.print("高:");
double height = input.nextDouble();
double s = (top + bottom) * height / 2;
System.out.println("面积:"+s);
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Calendar;
public class Test {
public static int getDays(int year ,int month){
int days = 0 ;
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, month-1);
calendar.set(Calendar.DAY_OF_MONTH, 1);
days = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
return days ;
}
public static void main(String[] args) {
int year = 0, moth = 0, len = 0;
System.out.print("请输入年数");
try {
BufferedReader br = new BufferedReader(new InputStreamReader(
System.in));
year = Integer.parseInt(br.readLine());
System.out.print("请输入月数");
moth = Integer.parseInt(br.readLine());
System.out.println(year+"年"+moth+"月 的天数:" + getDays(year,moth));
} catch (IOException e) {
}
}
}
追问
你这是什么鬼
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询