Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int k, n;
- cin >> k >> n;
- bool deljivost = true;
- int i = 1;
- while ((i <= n) && deljivost == true) {
- if (k % i == 0) {
- deljivost = true;
- }
- else {
- deljivost = false;
- }
- i++;
- }
- if (deljivost == true) {
- cout << "da";
- }
- else if (deljivost != true) {
- cout << "ne";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement