#include <iostream>#include <cmath>int main() { double x; double y; double z; std::string variant; std::cout << "Ievadi X vertibu!" << std::endl; if (std::cin >> x) { std::cout << "X - " << x; std::cout << "Ievadi Y vertibu!" << std::endl; if (std::cin >> y) { std::cout << "Y - " << y; if (x < -10 && y < -5) { z = (1 / x) + (1 / y); variant = "PIRMAIS"; } else if ((-10 <= x && x < 0) && (-5 <= y && y < 0)) { z = (x - y) / (x + y); variant = "OTRAIS"; } else if ((0 <= x && x < 2 * M_PI) && (y >= 0 && y < (M_PI / 2))) { z = std::sin(x) / std::cos(y); variant = "TRESHAIS"; } else { z = log((pow(x, 2)) + pow(y, 2)); } } else { std::cerr << "Y ievade bija nepareiza"; } } std::cout << std::endl; std::cout << "result: " << z << std::endl; std::cout << variant; return 0;}
Hello coders! I am looking for help for my c++ project. The code is almost correct and working but in the terminal it finds one problem expected ‘;’ before ‘if’gcc
. Where is my error I still don't get it and I am confused, maybee this error is for me. Can someone help me please, explain me where is the issue?