Project Euler Q3

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
354 B
7
Indexable
Never
#include <iostream>

using namespace std;

int main()
{
    // 600.851.475.143
    long long int n = 13195;
    long int max;
    
    for (int x; x < n; x++){
        //cout << x << endl;
        if (n % x == 0){
            if (x > max){
                max = x;
            }
        }
        
    }
    
    cout << endl << max;
    
    return 0;
}