#include <iostream>
#include <vector>
using namespace std;
double n1,n2,p;
void solve1(){
if(1 + 2*n2 == 0){
cout << "Error";
return;
}
cout << (sin(n1 - 2*n2))/(1 + 2*n2);
void solve2(){
cout << 5 * (n1 - 3*cos(n2));
signed main(){
cin >> n1 >> n2 >> p;
if(2*n2 > p && 2*n2 <= 1)
solve1();
else if(n1 - 2*n2 > 1)
solve2();
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
#include <vector>
using namespace std;
double n1,n2,p;
void solve1(){
if(1 + 2*n2 == 0){
cout << "Error";
return;
}
cout << (sin(n1 - 2*n2))/(1 + 2*n2);
}
void solve2(){
cout << 5 * (n1 - 3*cos(n2));
}
signed main(){
cin >> n1 >> n2 >> p;
if(2*n2 > p && 2*n2 <= 1)
solve1();
else if(n1 - 2*n2 > 1)
solve2();
}