Advertisement
Guest User

brotmonate für den süßen <3

a guest
Mar 25th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement