Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int x;
- cout<<"Insert your number: ";
- cin>>x;
- if (x<5) //ветка 1
- { if (x<-3) //AB
- {
- if (x<-7)
- {
- cout<<"x belongs to A";
- }
- else
- {
- cout<<"x belongs to B";
- }
- }
- else //CD
- {
- if (x<0)
- {
- cout<<"x belongs to C";
- }
- else
- {
- cout<<"x belongs to D";
- }
- }
- }
- else //ветка 2
- { if (x<22) //EF
- {
- if (x<11)
- {
- cout<<"x belongs to E";
- }
- else
- {
- cout<<"x belongs to F";
- }
- }
- else //GH
- {
- if (x<55)
- {
- cout<<"x belongs to G";
- }
- else
- {
- cout<<"x belongs to H";
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement