3 solutions

  • 1
    @ 2024-1-25 10:37:33
    #include<bits/stdc++.h>
    #define it long long
    using namespace std;
    double r1,r2,r;
    int main(){
    	cin>>r1>>r2;
    	r=1/(1/r1+1/r2);
    	cout<<fixed<<setprecision(2)<<r<<"\n";
    	return 0;
    }
    
    • 1
      @ 2023-10-29 14:20:20
      #include<iostream>
      using namespace std;
      int main()
      {
       float a,b;
       cin>>a>>b;//输入
       printf("%.2f",1.0/(1.0/a+1.0/b));//输出
       return 0;//完结散花!
      }
      
      • -1
        @ 2023-9-10 13:59:04
        #include <set>
        #include <ios>
        #include <list>
        #include <cmath>
        #include <ctime>
        #include <queue>
        #include <deque>
        #include <stack>
        #include <vector>
        #include <bitset>
        #include <cctype>
        #include <cerrno>
        #include <cwchar>
        #include <cstdio>
        #include <fenv.h>
        #include <iosfwd>
        #include <string>
        #include <limits>
        #include <math.h>
        #include <cstdlib>
        #include <iomanip>
        #include <clocale>
        #include <complex>
        #include <cstring>
        #include <cstring>
        #include <cwctype>
        #include <istream>
        #include <ostream>
        #include <sstream>
        #include <fstream>
        #include <utility>
        #include <stdio.h>
        #include <iostream>
        #include <stdint.h>
        #include <string.h>
        #include <tgmath.h>
        #include <complex.h>
        #include <algorithm>
        #include <exception>
        #include <stdbool.h>
        #include <stdexcept>
        #include <streambuf>
        #include <functional>
        #include <inttypes.h>
        #include <bits/stdc++.h>
        using namespace std;
        int main(){
        	double a,b,q,w,e;
        	cin >> a >> b;
        	q=1/a;
        	w=1/b;
        	e=1/(q+w);
        	cout << fixed << setprecision(2)<<e;
        	return 0;
        }
        
        
        • 1

        Information

        ID
        501
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        1
        Tags
        # Submissions
        76
        Accepted
        55
        Uploaded By