October 2018 1 35 Report

Programowanie w C++:

Sprawdź czy x należy do przedziału (20,40) lub y należy do przedziału [23,27)

Mam wykonane zadanie ale zależy mi na tym aby jak osoba wybierze powiedzmy x nie wyświetlało sie też y ponieważ w zadaniu ma być x LUB y. Co można zmienić, żeby to osiągnąć.. :)

#include <iostream>
using namespace std;
int main() {
{
int x;
cout<<"Podaj x:"<<endl;
cin>>x;
cout<<endl<<(x>20 && x<40)<<endl;

}

{ int y;
cout<<"Podaj y:"<<endl;
cin>>y;
cout<<endl<<(y>=23 && y<27)<<endl;

}
}


More Questions From This User See All

Recommend Questions



Life Enjoy

" Life is not a problem to be solved but a reality to be experienced! "

Get in touch

Social

© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.