1 条题解

  • 0
    @ 2025-4-12 22:06:17

    C :

    #include<stdio.h>
    #include<math.h>
    void main(){
         int F;
    	 double c;
    	 while(scanf("%d",&F)!=EOF){
    		c=(F*100.0/100.0-32)*5/9;
    		printf("%.2f\n",c);
    		}
    
    }
    

    C++ :

    #include<iostream>
    using namespace std;
    int main(){
      int a;
      double b;
      while(cin>>a){
        
        
          b =  (a-32) * 5 / 9.00;
    	  
          printf("%0.2f",b);
    	  cout<<endl;
        
      }
      return 0;
    }
    
    

    Pascal :

    var
    f,c:real;
    begin
     while not(eof)do
     begin
      read(f);
      c:=(f-32)*5/9;
      writeln(c:0:2);
     end;
    end.
    

    Java :

    import java.util.*; 
    public class Main{ 
    public static void main(String[] args)  { 
     Scanner in=new Scanner(System.in); 
      while(true){
          int F=in.nextInt();
          String Fstr=""+F;
          if(Fstr==null)break;
          	double f=(double)F;
          double c= (f-32)*5/9;
          System.out.printf("%4.2f\n",c);
          }
        }
    }
    
    
    • 1

    信息

    ID
    2805
    时间
    1000ms
    内存
    32MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者