Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- void main() {
- int funkcia, a, b;
- bool c, d, e;
- system("TITLE logicke funkcie");
- do {
- system("cls");
- cout << "menu" << endl;
- cout << "1-info 2-AND 3-ekvivalencia 4-vyraz 5-TAB NOR 6-koniec" << endl;
- cin >> funkcia;
- switch (funkcia)
- {
- case 1: {cout << "informacie o programe" << endl;
- cout << "meno riesitela : liborko" << endl;
- cout << "trieda : III.C" << endl;
- cout << " _ " << endl;
- cout << " | | " << endl;
- cout << " | | " << endl;
- cout << " | | " << endl;
- cout << " | | " << endl;
- cout << " | |______ " << endl;
- cout << " |________| " << endl;
- break; }
- case 2: {cout << "funkcia AND" << endl;
- cout << "zadaj C:" << endl;
- cin >> c;
- cout << "zadaj D:" << endl;
- cin >> d;
- e = c * d;
- cout << "vysledok je: " << e << endl;
- break; }
- case 3: {cout << "ekvivalencia" << endl;
- cout << "zadaj C:" << endl;
- cin >> c;
- cout << "zadaj D:" << endl;
- cin >> d;
- e = (!c || d) && (c || !d);
- cout << "vysledok je: " << e << endl;
- break; }
- case 4: {cout << "vyraz" << endl;
- cout << "zadaj cislo a" << endl;
- cin >> a;
- cout << "zadaj b:" << endl;
- cin >> b;
- e = ((a > 10) && (b >= 20));
- cout << "vysledok je " << e << endl;
- break; }
- case 5: {cout << "TAB NOR" << endl;
- cout << " A B | C" << endl;
- cout << "------------" << endl;
- cout << " 0 0 | 1 " << endl;
- cout << " 0 1 | 0" << endl;
- cout << " 1 0 | 0" << endl;
- cout << " 1 1 | 0" << endl;
- break; }
- case 6: {cout << "koniec" << endl; break; }
- default: {cout << "zadal si zlu funkciu" << endl; break; }
- }
- system("pause");
- } while (funkcia != 6);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement