fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. double f1(double x,double y){
  6. return log(x*y);
  7. }
  8. double f2(double x,double y){
  9. return abs(x)+cos(x*y);
  10. }
  11. int main() {
  12. double x,y;
  13. int n;
  14. cin>>n;
  15. for (int i=0;i<n;i++){
  16. cout<<"\n--"<<i<<"--\n";
  17. cout<<"meaning of x"<<endl;
  18. cin>>x;
  19. cout<<"meaning of y"<<endl;
  20. cin>>y;
  21. if(x*y>0){
  22. cout<<"meaning of f1:"<<f1(x,y)<<"\n";
  23. }
  24. else { cout<<"undefined";
  25. }
  26. int smth=f2(x,y);
  27. cout<<"meaning of f2:"<<smth<<"\n";
  28. if(smth*y>0){
  29. int smth1=f1(smth,y);
  30. cout<<"new meaning:"<<smth1<<"\n";
  31. }
  32. else { cout<<"undefined";
  33. }
  34. }
  35. return 0;
  36. }
Success #stdin #stdout 0.01s 5308KB
stdin
1
1
1
stdout
--0--
meaning of x
meaning of y
meaning of f1:0
meaning of f2:1
new meaning:0