发布网友 发布时间:2024-10-23 07:06
共3个回答
热心网友 时间:2024-10-23 07:33
class Test
{
public static void main(String[] args)
{
System.out.print("请输入华氏温度:");
Scanner in=new Scanner(System.in);
double hua=in.nextDouble();
double she=5/9.0*(hua-32);
System.out.println();
System.out.println("华氏度为:"+hua);
System.out.printf("摄氏度为:%.2f",she);
}
}
热心网友 时间:2024-10-23 07:27
import java.util.Scanner;
public class com
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
while (sc.hasNext())
{
String i = sc.next();
double str1 = Double.parseDouble(i);
double b = (str1 - 32) * 5 / 9;
System.out.println(b);
}
}
}
热心网友 时间:2024-10-23 07:25
import java.util.*;
public class Change
{
//第一种
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("请输入华氏摄氏度:");
double f=input.nextDouble();
System.out.println("摄氏摄氏度:"+5*(f-32)/9+"℃");
}
//第二种
// {
// Scanner input=new Scanner(System.in);
// double f=input.nextDouble();
// return f=5*(f-32)/9;
//
// }
// public static void main(String[] args)
// {
// System.out.println("请输入华氏摄氏度:");
// System.out.println("摄氏摄氏度:"+Change());
// }
}
望采纳!
热心网友 时间:2024-10-23 07:29
class Test
{
public static void main(String[] args)
{
System.out.print("请输入华氏温度:");
Scanner in=new Scanner(System.in);
double hua=in.nextDouble();
double she=5/9.0*(hua-32);
System.out.println();
System.out.println("华氏度为:"+hua);
System.out.printf("摄氏度为:%.2f",she);
}
}
热心网友 时间:2024-10-23 07:30
import java.util.*;
public class Change
{
//第一种
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("请输入华氏摄氏度:");
double f=input.nextDouble();
System.out.println("摄氏摄氏度:"+5*(f-32)/9+"℃");
}
//第二种
// {
// Scanner input=new Scanner(System.in);
// double f=input.nextDouble();
// return f=5*(f-32)/9;
//
// }
// public static void main(String[] args)
// {
// System.out.println("请输入华氏摄氏度:");
// System.out.println("摄氏摄氏度:"+Change());
// }
}
望采纳!
热心网友 时间:2024-10-23 07:29
import java.util.Scanner;
public class com
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
while (sc.hasNext())
{
String i = sc.next();
double str1 = Double.parseDouble(i);
double b = (str1 - 32) * 5 / 9;
System.out.println(b);
}
}
}