fork(101) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a, b, c;
  8. int count0 = 0;
  9. int count1 = 0;
  10. int count2 = 0;
  11.  
  12. for (a = 1; a<=98; a++)
  13. for (b = 1; b<=98; b++)
  14. for (c = 1; c<=98; c++)
  15. count0++;
  16.  
  17. for (a = 1; a<=98; a++)
  18. for (b = a+1; b<=98; b++)
  19. for (c = b+1; c<=98; c++)
  20. count1++;
  21.  
  22. for (a = 1; a<=98; a++)
  23. for (b = 1; a+b<100; b++)
  24. count2++;
  25.  
  26. cout << "count0 = " << count0 << endl;
  27. cout << "count1 = " << count1 << endl;
  28. cout << "count2 = " << count2 << endl;
  29.  
  30. return 0;
  31. }
  32.  
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
count0 = 941192
count1 = 152096
count2 = 4851