帮忙编写一个java程序(很基础的那种).
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/05 08:11:42
帮忙编写一个java程序(很基础的那种).
Write a program which accepts a time interval in seconds and prints the equivalent time in hours minutes seconds.One hour is 3600 seconds and one minute is 60 seconds.
Write a program which accepts a time interval in seconds and prints the equivalent time in hours minutes seconds.One hour is 3600 seconds and one minute is 60 seconds.
public class TimeTran {
public static void translation(int seconds){
int hh = seconds/3600;
int mm = (seconds - hh * 3600)/60;
int ss = seconds - hh * 3600 - mm * 60;
System.out.println("时间转换之后为" + hh + "小时" + mm + "分" + ss + "秒");
}
public static void main(String[] args) {
translation(3601);
}
}
public static void translation(int seconds){
int hh = seconds/3600;
int mm = (seconds - hh * 3600)/60;
int ss = seconds - hh * 3600 - mm * 60;
System.out.println("时间转换之后为" + hh + "小时" + mm + "分" + ss + "秒");
}
public static void main(String[] args) {
translation(3601);
}
}
请各位高手帮忙编写JAVA程序:求一个3阶方阵的对角线上个元素之和.
用java循环编写一个程序题目.
JAVA 写一个 很基础的题
用JAVA编写一个程序能统计每个长度的单词的数量!
用java编写一个输出1到00以内的素数并求和的程序
用java 编写一个程序,要求输入圆的半径,求圆的周长,面积.
求大神帮忙写一个java程序
JAVA语言:编写一个程序,统计出下列段落中单词的个数.
1、编写一个Java程序,计算并输出1+2!+3!+…+10!的值.
用Java application 编写一个矩形的程序,能输出周长和面积
编写一个JAVA程序,求1!+2!+3!+.+10!的结果,并将结果输出
编写一个java程序,计算1+2!+3!+...从第10项到第20项的