fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main(void) {
  5. int stud=0,teac=0,i=0;
  6. for(i=0;i<100000;i++){
  7. if(stud!=100){
  8. stud++;
  9. if(teac<20){
  10. teac++;
  11. }
  12. else if(teac==20){
  13. teac=(teac*8)/stud;
  14. }
  15. }
  16. else if(stud>100){
  17. printf("Student:%d\n",stud);
  18. return 0;
  19. }
  20. else if(stud==100){
  21. printf("teacher:%d\n",teac);
  22. printf("student:%d\n",stud);
  23. return 0;
  24. }
  25. }
  26. printf("false\n");
  27.  
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
teacher:12
student:100