fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(){
  5.  
  6. char question[256];
  7. char answer[256];
  8. char user_input[256];
  9.  
  10. fgets(question, 256, stdin);
  11. fgets(answer, 256, stdin);
  12.  
  13. puts(question);
  14. fgets(user_input, 256, stdin);
  15. unsigned int answer_length = strlen(user_input);
  16. if(strncmp(user_input, answer, strlen(user_input)) == 0)
  17. {
  18. printf("Good job!\n");
  19. }
  20. else
  21. {
  22. printf("Nope its:\n");
  23. puts(answer);
  24. }
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 9432KB
stdin
Name
Jolly
Jolly
stdout
Name

Good job!