fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. pair<double, double> SumDob (double a, double b){
  6. return make_pair(a + b, a * b);
  7. }
  8.  
  9. int main() {
  10. int n;
  11. cin>>n;
  12. while (n--){
  13. double a, b;
  14. cin>>a>>b;
  15. cout<<fixed<<setprecision(4)<<SumDob(a,b).first<<" "<<SumDob(a,b).second<<endl;
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 15232KB
stdin
2
6 7.5
2.1 2.0
stdout
13.5000 45.0000
4.1000 4.2000