这个怎么写代码啊,一点思路都没有,怎么办啊,求解⋯⋯⋯⋯⋯⋯⋯⋯
2条回答
- 丑旦 2016-03-07 13:45关注
借鉴一下,改改。
public static void main(String[] args) {
// TODO Auto-generated method stub
Runtime runtime = Runtime.getRuntime();
System.out.println("占用内存:"
+ (runtime.totalMemory() - runtime.freeMemory()));
long timeStamp = System.currentTimeMillis();
Scanner scanner = new Scanner(System.in);
while (scanner.hasNextInt()) {
int tem = scanner.nextInt();
System.out.println("输入的华氏温度是:" + tem);
Integer temperature = (tem - 32) * 5 / 9;
System.out.println("输出的摄氏温度是:" + temperature);
System.out.println("消耗时间(包含输入):"
+ (System.currentTimeMillis() - timeStamp) + "毫秒");
}
scanner.close();
}本回答被题主选为最佳回答 , 对您是否有帮助呢?解决评论 打赏 举报无用 2
悬赏问题
- ¥15 fluent的在模拟压强时使用希望得到一些建议
- ¥15 STM32驱动继电器
- ¥15 Windows server update services
- ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
- ¥15 模糊pid与pid仿真结果几乎一样
- ¥15 java的GUI的运用
- ¥15 Web.config连不上数据库
- ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
- ¥15 怎么配置广告联盟瀑布流
- ¥15 Rstudio 保存代码闪退