Skip to content

Instantly share code, notes, and snippets.

@SteelPh0enix
Last active July 12, 2017 07:32
Show Gist options
  • Select an option

  • Save SteelPh0enix/63af57050e095ac56a56cfb6b11168c3 to your computer and use it in GitHub Desktop.

Select an option

Save SteelPh0enix/63af57050e095ac56a56cfb6b11168c3 to your computer and use it in GitHub Desktop.
little prettier
#include <iostream>
int main() {
//tworzymy i inicjalizujemy dwie zmienne o typie bool
bool x {true}, y {false};
//tworzymy zmienną 'z' i inicjalizujemy ją zanegowaną wartoscią zmiennej x (czyli false)
bool z {!x};
//przypisujemy zmiennej 'x' wartosc wyrazenia y OR z, czyli false (poniewaz ani y ani z nie mają wartosci true)
x = y || z;
std::cout << std::boolalpha
<< x << ", "
<< y << ", "
<< z << ", "
<< !(y && z) << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment