SHARE
TWEET

brotmonate für den süßen <3

a guest Mar 25th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main()
  6. {
  7.     char monat [100];
  8.     int brot = 0;
  9.     printf("Geben Sie einen Monat ein: \n");
  10.     fgets(monat, 100, stdin);
  11.  
  12.     int i = 0;
  13.     for(i=strlen(monat)-1; i>0; i--){
  14.         if(monat[i] == 'r'){
  15.             brot = 1;
  16.         }
  17.     }
  18.     if(brot == 0){
  19.         printf("\nBewahren Sie das Brot besser im Kuehlschrank auf!\n");
  20.     }
  21.     else if(brot == 1){
  22.         printf("Brot ist safe");
  23.     }
  24.  
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top