code

#include "iostream" #include"math.h" using namespace std; int main() { int a, b, c, d, s, t, u, p, p1, p2; s != 0; t != 0; cout << "Vvedite a,b,c,d,s,t,u " << endl; cin >> a >> b >> c >> d >> s >> t >> u; p1 = s*a + t*b + u; p2 = s*c + t*d + u; if (p1>0&&p2>0) || (p1<0&&p2<0); cout << "Nalezat odniy ploschini" << endl; return 0; if (p1<0&&p2>0) || (p1>0&&p2<0); cout << "Nalezat riznim ploschinam" << endl; return 0; } 
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

2 answers 2

And what is

 if (p1 > 0 && p2 > 0) || (p1 < 0 && p2 < 0); 

The if has the form

 if ( условие ) { что-то-там } [else { что-то-там-еще }] 

You have one condition without brackets and no instructions for execution ... In fact -

 if условие 

Here is what your code should look like:

 #include <iostream> #include <math.h> using namespace std; int main() { int a, b, c, d, s, t, u, p, p1, p2; s != 0; t != 0; cout << "Vvedite a,b,c,d,s,t,u " << endl; cin >> a >> b >> c >> d >> s >> t >> u; p1 = sa + tb + u; p2 = sc + td + u; if ((p1 > 0 && p2 > 0) || (p1 < 0 && p2 < 0)) { cout << "Nalezat odniy ploschini" << endl; return 0; } if ((p1 < 0 && p2 > 0) || (p1 > 0 && p2 < 0)) { cout << "Nalezat riznim ploschinam" << endl; return 0; } } 

By the way, pay attention to the angle brackets <> in the directives #include !

    1. The if logical expression must be enclosed in parentheses.
    2. Everything that should be inside a condition should be placed inside curly brackets

       if ((p1>0&&p2>0) || (p1<0&&p2<0)){ cout << "Nalezat odniy ploschini" << endl; return 0; }