Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int a, b, k, br = 0;
- do {
- cout << "a = "; cin >> a;
- } while (a < 0 || a > 10);
- do {
- cout << "b = "; cin >> b;
- } while (b < 0 || b > 10);
- do {
- cout << "k = "; cin >> k;
- } while (k < 1 || k > 100);
- for (int i = 0; i <= 9; i++)
- {
- if ((a * 100 + i * 10 + b * 1) % k == 0)
- br++;
- }
- cout << br << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment