Skip to main content
Shorten SO link
Source Link
Toby Speight
  • 81.8k
  • 14
  • 101
  • 308
  1. Consider adopting any of the common styles for code-formatting.
    As-is, your current formatting seriously impedes readability.

  2. #include <bits/stdc++.h> is a bad idea, sharply limiting portability adand increasing compile-times. See: How does #include <bits/stdc++.h> work in C++?How does #include <bits/stdc++.h> work in C++?
    Just include those headers you need, which are <vector> and <iostream>.

  3. You are courting conflicting symbols and general bafflement with any minor change of your toolchain. See: Why is using namespace std; considered bad practice?Why is using namespace std; considered bad practice?

  4. You are using the popular for-if-antipattern. See Introducing the for-if anti-pattern
    Why don't you just enumerate the ones you are actually interested in?

  5. A for-range-loop is simpler than explicitly using iterators/indices. Unless you actually need them.

  6. In the end you don't actually want that whole list, only whether one of them divides your input-number. So why store them at all, and why also those bigger than the input-number?

  7. return 0; is implicit for main in C++.

  1. Consider adopting any of the common styles for code-formatting.
    As-is, your current formatting seriously impedes readability.

  2. #include <bits/stdc++.h> is a bad idea, sharply limiting portability ad increasing compile-times. See: How does #include <bits/stdc++.h> work in C++?
    Just include those headers you need, which are <vector> and <iostream>.

  3. You are courting conflicting symbols and general bafflement with any minor change of your toolchain. See: Why is using namespace std; considered bad practice?

  4. You are using the popular for-if-antipattern. See Introducing the for-if anti-pattern
    Why don't you just enumerate the ones you are actually interested in?

  5. A for-range-loop is simpler than explicitly using iterators/indices. Unless you actually need them.

  6. In the end you don't actually want that whole list, only whether one of them divides your input-number. So why store them at all, and why also those bigger than the input-number?

  7. return 0; is implicit for main in C++.

  1. Consider adopting any of the common styles for code-formatting.
    As-is, your current formatting seriously impedes readability.

  2. #include <bits/stdc++.h> is a bad idea, sharply limiting portability and increasing compile-times. See: How does #include <bits/stdc++.h> work in C++?
    Just include those headers you need, which are <vector> and <iostream>.

  3. You are courting conflicting symbols and general bafflement with any minor change of your toolchain. See: Why is using namespace std; considered bad practice?

  4. You are using the popular for-if-antipattern. See Introducing the for-if anti-pattern
    Why don't you just enumerate the ones you are actually interested in?

  5. A for-range-loop is simpler than explicitly using iterators/indices. Unless you actually need them.

  6. In the end you don't actually want that whole list, only whether one of them divides your input-number. So why store them at all, and why also those bigger than the input-number?

  7. return 0; is implicit for main in C++.

broken link fixed, cf. https://meta.stackoverflow.com/a/406565/4751173
Source Link
  1. Consider adopting any of the common styles for code-formatting.
    As-is, your current formatting seriously impedes readability.

  2. #include <bits/stdc++.h> is a bad idea, sharply limiting portability ad increasing compile-times. See: How does #include <bits/stdc++.h> work in C++?
    Just include those headers you need, which are <vector> and <iostream>.

  3. You are courting conflicting symbols and general bafflement with any minor change of your toolchain. See: Why is using namespace std; considered bad practice?Why is using namespace std; considered bad practice?

  4. You are using the popular for-if-antipattern. See Introducing the for-if anti-patternIntroducing the for-if anti-pattern
    Why don't you just enumerate the ones you are actually interested in?

  5. A for-range-loop is simpler than explicitly using iterators/indices. Unless you actually need them.

  6. In the end you don't actually want that whole list, only whether one of them divides your input-number. So why store them at all, and why also those bigger than the input-number?

  7. return 0; is implicit for main in C++.

  1. Consider adopting any of the common styles for code-formatting.
    As-is, your current formatting seriously impedes readability.

  2. #include <bits/stdc++.h> is a bad idea, sharply limiting portability ad increasing compile-times. See: How does #include <bits/stdc++.h> work in C++?
    Just include those headers you need, which are <vector> and <iostream>.

  3. You are courting conflicting symbols and general bafflement with any minor change of your toolchain. See: Why is using namespace std; considered bad practice?

  4. You are using the popular for-if-antipattern. See Introducing the for-if anti-pattern
    Why don't you just enumerate the ones you are actually interested in?

  5. A for-range-loop is simpler than explicitly using iterators/indices. Unless you actually need them.

  6. In the end you don't actually want that whole list, only whether one of them divides your input-number. So why store them at all, and why also those bigger than the input-number?

  7. return 0; is implicit for main in C++.

  1. Consider adopting any of the common styles for code-formatting.
    As-is, your current formatting seriously impedes readability.

  2. #include <bits/stdc++.h> is a bad idea, sharply limiting portability ad increasing compile-times. See: How does #include <bits/stdc++.h> work in C++?
    Just include those headers you need, which are <vector> and <iostream>.

  3. You are courting conflicting symbols and general bafflement with any minor change of your toolchain. See: Why is using namespace std; considered bad practice?

  4. You are using the popular for-if-antipattern. See Introducing the for-if anti-pattern
    Why don't you just enumerate the ones you are actually interested in?

  5. A for-range-loop is simpler than explicitly using iterators/indices. Unless you actually need them.

  6. In the end you don't actually want that whole list, only whether one of them divides your input-number. So why store them at all, and why also those bigger than the input-number?

  7. return 0; is implicit for main in C++.

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
  1. Consider adopting any of the common styles for code-formatting.
    As-is, your current formatting seriously impedes readability.

  2. #include <bits/stdc++.h> is a bad idea, sharply limiting portability ad increasing compile-times. See: How does #include <bits/stdc++.h> work in C++?How does #include <bits/stdc++.h> work in C++?
    Just include those headers you need, which are <vector> and <iostream>.

  3. You are courting conflicting symbols and general bafflement with any minor change of your toolchain. See: Why is using namespace std; considered bad practice?Why is using namespace std; considered bad practice?

  4. You are using the popular for-if-antipattern. See Introducing the for-if anti-pattern
    Why don't you just enumerate the ones you are actually interested in?

  5. A for-range-loop is simpler than explicitly using iterators/indices. Unless you actually need them.

  6. In the end you don't actually want that whole list, only whether one of them divides your input-number. So why store them at all, and why also those bigger than the input-number?

  7. return 0; is implicit for main in C++.

  1. Consider adopting any of the common styles for code-formatting.
    As-is, your current formatting seriously impedes readability.

  2. #include <bits/stdc++.h> is a bad idea, sharply limiting portability ad increasing compile-times. See: How does #include <bits/stdc++.h> work in C++?
    Just include those headers you need, which are <vector> and <iostream>.

  3. You are courting conflicting symbols and general bafflement with any minor change of your toolchain. See: Why is using namespace std; considered bad practice?

  4. You are using the popular for-if-antipattern. See Introducing the for-if anti-pattern
    Why don't you just enumerate the ones you are actually interested in?

  5. A for-range-loop is simpler than explicitly using iterators/indices. Unless you actually need them.

  6. In the end you don't actually want that whole list, only whether one of them divides your input-number. So why store them at all, and why also those bigger than the input-number?

  7. return 0; is implicit for main in C++.

  1. Consider adopting any of the common styles for code-formatting.
    As-is, your current formatting seriously impedes readability.

  2. #include <bits/stdc++.h> is a bad idea, sharply limiting portability ad increasing compile-times. See: How does #include <bits/stdc++.h> work in C++?
    Just include those headers you need, which are <vector> and <iostream>.

  3. You are courting conflicting symbols and general bafflement with any minor change of your toolchain. See: Why is using namespace std; considered bad practice?

  4. You are using the popular for-if-antipattern. See Introducing the for-if anti-pattern
    Why don't you just enumerate the ones you are actually interested in?

  5. A for-range-loop is simpler than explicitly using iterators/indices. Unless you actually need them.

  6. In the end you don't actually want that whole list, only whether one of them divides your input-number. So why store them at all, and why also those bigger than the input-number?

  7. return 0; is implicit for main in C++.

deleted 18 characters in body
Source Link
Deduplicator
  • 19.3k
  • 1
  • 31
  • 65
Loading
added 33 characters in body
Source Link
Deduplicator
  • 19.3k
  • 1
  • 31
  • 65
Loading
added 396 characters in body
Source Link
Deduplicator
  • 19.3k
  • 1
  • 31
  • 65
Loading
added 122 characters in body
Source Link
Deduplicator
  • 19.3k
  • 1
  • 31
  • 65
Loading
Post Undeleted by Deduplicator
added 147 characters in body
Source Link
Deduplicator
  • 19.3k
  • 1
  • 31
  • 65
Loading
Post Deleted by Deduplicator
Source Link
Deduplicator
  • 19.3k
  • 1
  • 31
  • 65
Loading