fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int N, minN;
  5. cin >> N;
  6. minN = 2;
  7. while ( N % minN !=0 ) {
  8. minN = minN + 1;
  9. }
  10. cout << minN;
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 5268KB
stdin
37
stdout
37