Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
307 B
2
Indexable
Never
#include <iostream>
using namespace std;

int alg (int x) {
	int flag = 0;
	while (flag != 1) {
		x++;
		int k = x;
		while (k % 5 == 0) {
			k = k / 5;
		}
		while (k % 3 == 0) {
			k = k / 3;
		}
		if (k == 1) {
			flag = 1;
		}		
	}
	return x;
}
int main() { 
	printf("otvet: %d\n", alg(0));
	return 0;
}