fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a;
  6. int n;
  7. cin >> n;
  8. for(int k = 1; k < 1001; k++){
  9. a = 0;
  10. for(int i = 0; i < k; i++){
  11. a++;
  12. for(int j = i + 1; j < k; j++){
  13. a++;
  14. }
  15. }
  16. int b = k + ((k*k - k) / 2);
  17. if(a != b)cout << " dd";
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5276KB
stdin
4
stdout
Standard output is empty