fork download
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.  
  5. int lastNum= 0;
  6. int currNum = 0;
  7.  
  8.  
  9. printf("Begin entering numbers with a space between them: ");
  10. scanf(" %d",&lastNum);
  11.  
  12. scanf(" %d",&currNum);
  13.  
  14. if(currNum < lastNum){
  15. printf("You fail \n");
  16. return 0;
  17. }
  18.  
  19. while(scanf(" %d",&currNum) == 1){
  20. if(currNum < lastNum || currNum < 0){
  21. printf("You fail \n");
  22. return 0;
  23. }
  24. currNum = lastNum;
  25. }
  26.  
  27. return 0;
  28. }
  29.  
  30.  
  31.  
Success #stdin #stdout 0s 2160KB
stdin
5 6 7
stdout
Begin entering numbers with a space between them: