View Code of Problem 31

#include <iostream>

using namespace std;

int main() {
    int k;
    while (cin >> k) {
        int n = 0;
        while (k) {
            n++;
             while((n % 3 != 2 || n % 5 != 3 || n % 7 != 2)) {
                 n++;
             }
             k--;
        }
        cout << n << endl;
    }
}

Double click to view unformatted code.


Back to problem 31