Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdbool.h>
- #include <stdlib.h>
- #include <string.h>
- void menu(){
- printf("\n%s\n%s\n%s\n%s\n%s\n%s",
- "======================================================",
- "Klawisze:",
- "1 -> wczytaj i wypisz",
- "2 -> wczytaj, zaszyfruj i wypisz",
- "0 -> wyjdz",
- "======================================================"
- );
- }
- char *cezar(char *wiadomosc){
- return wiadomosc;
- }
- int main(void)
- {
- int znak;
- char sms[180];
- while(true){
- menu();
- printf("\n%s", "Podaj opcje: ");
- scanf("%d", &znak);
- printf("\n");
- switch(znak){
- case 1:
- fgetc(stdin);
- printf("\nPodaj wiadomosc: ");
- fgets(sms, 180, stdin);
- printf("\nTwoja wiadomosc: %s", sms);
- break;
- case 2:
- fgetc(stdin);
- printf("\nPodaj wiadomosc: ");
- fgets(sms, 180, stdin);
- printf("\nTwoja zaszyfrowana wiadomosc: %s", cezar(sms));
- break;
- case 0:
- default:
- printf("%s", "Wyszedles!");
- return EXIT_SUCCESS;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement