/* Nguyen Huong Duyen 6251071018 CQ.62CNTT */ #include #include #include char *input; void parser (char* input){ } void Display (){ fprintf(stdout,"\ 1. Negation / Phep phu dinh\n\ 2. Conjuction / Phep hoi\n\ 3. Disjunction / Phep tuyen\n\ 4. Conditional Statement / Keo theo\n\ 5. Biconditional Statement / Keo theo 2 chieu\n"); } void Neg(){ printf("Phep phu dinh: "); printf("\n--------------"); printf("\n| P | -P |"); printf("\n| 1 | 0 |"); printf("\n| 0 | 1 |"); printf("\n--------------"); } void Conj(){ printf("Phep hoi: "); printf("\n---------------------"); printf("\n| P | Q | P^Q |"); printf("\n| 0 | 0 | 0 |"); printf("\n| 0 | 1 | 0 |"); printf("\n| 1 | 0 | 0 |"); printf("\n| 1 | 1 | 1 |"); printf("\n---------------------"); } void Dis(){ printf("Phep tuyen: "); printf("\n---------------------"); printf("\n| P | Q | PvQ |"); printf("\n| 0 | 0 | 0 |"); printf("\n| 0 | 1 | 1 |"); printf("\n| 1 | 0 | 1 |"); printf("\n| 1 | 1 | 1 |"); printf("\n---------------------"); } void MonoCon(){ printf("Phep keo theo: "); printf("\n----------------------"); printf("\n| P | Q | P->Q |"); printf("\n| 0 | 0 | 1 |"); printf("\n| 0 | 1 | 1 |"); printf("\n| 1 | 0 | 0 |"); printf("\n| 1 | 1 | 1 |"); printf("\n----------------------"); } void BiCon(){ printf("Phep keo theo hai chieu: "); printf("\n-----------------------"); printf("\n| P | Q | P<->Q |"); printf("\n| 0 | 0 | 1 |"); printf("\n| 0 | 1 | 0 |"); printf("\n| 1 | 0 | 0 |"); printf("\n| 1 | 1 | 1 |"); printf("\n-----------------------"); } int Input (int ch){ scanf("%d",&ch); return ch; } int main (){ int ch, check; do { system ("cls"); Display(); check = scanf("%d%*c", &ch); getchar(); switch (ch) { case 1: Neg(); break; case 2: Conj(); break; case 3: Dis(); break; case 4: MonoCon(); break; case 5: BiCon(); break; default: //Input(ch); //Display(); break; } } while (!check); }