Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main()
- {
- char monat [100];
- int brot = 0;
- printf("Geben Sie einen Monat ein: \n");
- fgets(monat, 100, stdin);
- int i = 0;
- for(i=strlen(monat)-1; i>0; i--){
- if(monat[i] == 'r'){
- brot = 1;
- }
- }
- if(brot == 0){
- printf("\nBewahren Sie das Brot besser im Kuehlschrank auf!\n");
- }
- else if(brot == 1){
- printf("Brot ist safe");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement