fork download
  1. #define numberofButtons 3
  2.  
  3. #include <stdio.h>
  4. #include<time.h>
  5.  
  6. void wait(double x)
  7. {
  8. clock_t begin, end;
  9. double time_spent, limit=1000*60*x;
  10. begin = clock();
  11. while(time_spent<= limit)
  12. {
  13. end = clock();
  14. time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
  15. }
  16. }
  17.  
  18.  
  19. int main(void)
  20. {
  21. char c;
  22. while((c = getchar())!='e')
  23. {
  24. if (c == 'a')
  25. {
  26. printf("I am in a! Come after 15 min!\n");
  27. wait(15);
  28. printf("WOW! How could you pass 15 min!!\n");
  29. }
  30. if (c == 'b')
  31. {
  32. printf("I am in b! Come after 15 min!\n");
  33. wait(15);
  34. printf("WOW! How could you pass 15 min!!\n");
  35. }
  36. if (c == 'c')
  37. {
  38. printf("I am in c! Come after 15 min!\n");
  39. wait(15);
  40. printf("WOW! How could you pass 15 min!!\n");
  41. }
  42. }
  43. }
  44.  
Success #stdin #stdout 0s 2160KB
stdin
e
stdout
Standard output is empty