Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. #define MAX_GET 5
  6.  
  7. int charLower(int c) {
  8.  
  9. if (c >= 65 && c <= 90) {
  10. return c+32;
  11. }
  12.  
  13. return c;
  14. }
  15.  
  16. int main() {
  17.  
  18. int correct;
  19. char gotca[MAX_GET];
  20. char answer[] = "noob";
  21.  
  22. printf("happy birthday john\ncongratulations for living this long!\n");
  23. printf("\nwhat is the best word to describe john? (clue: 4 letter word)\n");
  24.  
  25. do {
  26. printf("answer: ");
  27. fgets(gotca, MAX_GET + 1, stdin);
  28. gotca[strcspn(gotca, "\n")] = 0;
  29.  
  30. correct = strcmp(gotca, answer);
  31. if (correct != 0) {
  32. puts("incorrect..");
  33. }
  34. } while (correct != 0);
  35.  
  36. puts("\n\
  37. ) ( ) (\n\
  38. (^)(^)(^)(^)\n\
  39. _i__i__i__i_\n\
  40. (____________)\n\
  41. |####|>o<|###| \n\
  42. (____________)\n");
  43.  
  44. printf(":)");
  45.  
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement