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>22&&x<11) // not F
- {
- if(x>22&&x<55) //G or other
- {
- cout<<"x belongs to G";
- }
- else //EB or other
- {
- if((x>5&&x<11)or(x>-7&&x<-3)) //E or B
- {
- if(x>5&&x<11)
- {
- cout<<"x belongs to E";
- }
- else
- {
- cout<<"x belongs to B";
- }
- }
- else //other if not A
- {
- if(x>-7) //not A
- {
- if(x>0&&x<-3) //H or D if not C
- {
- if(x>55) //H
- {
- cout<<"x belongs to H";
- }
- else //D
- {
- cout<<"x belongs to D";
- }
- }
- else //C
- {
- cout<<"x belongs to C";
- }
- }
- else //A
- {
- cout<<"x belongs to A";
- }
- }
- }
- }
- else
- {
- cout<<"x belongs to F";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement