fork download
  1. #include <cstdio>
  2.  
  3. int main()
  4. {
  5. int n = 3; // libolné liché
  6. printf("n * (n - 1) / 2 = %d\n", n * (n - 1) / 2);
  7. printf("n / 2 * (n - 1) = %d\n", n / 2 * (n - 1));
  8. return 0;
  9. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
n * (n - 1) / 2 = 3
n / 2 * (n - 1) = 2