1 条题解

  • 0
    @ 2025-4-7 21:28:49

    C :

    #include<stdio.h>
    void main()
    {
    	double f,c;
    	scanf("%lf",&f);
    	printf("c=%.2lf\n",(5.0/9)*(f-32));
    }
    

    C++ :

    #include<iostream>
    #include<iomanip>
    #include<fstream>
    #include<string> 
    #include<climits>
    #include<cctype>
    #include<cmath>
    #include<cstring>
    using namespace std;
    
    int main()
    {
     //ifstream cin("aaa.txt");
      int i,j,n,m,k,sum,p,len,a[10001],l,count;
      
      float x,y;
      string s,b[1000];
      cin>>x;
      y=(x-32)*5.0/9;
      cout<<"c="<<fixed<<setprecision(2)<<y<<endl;
      
    
      	return 0;
    
    }
    

    Pascal :

    var c,F:real;
    begin
    read(F);
    if F>0 then write('c=',5*(F-32)/9:0:2)
           else write('c=',F:0:2);
    end.
    
    
    
    
    

    Python :

    # coding=utf-8
    f=float(input())
    c=5*(f-32)/9
    print('c=%.2f'%c)
    
    • 1

    信息

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