Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int chislo = 0, count = 0, chisloC1 = 0, chisloC2 = 0, currentEnd = 0, temporaryEnd = 0, counter = 0;
- cout << "Golunov loshara!" << endl;
- cout << "Vvedite chislo: ";
- cin >> chislo;
- cout << "Vvedite kolvo odinakovix chisel: ";
- cin >> count;
- chisloC1 = chisloC2 = chislo;
- while (chislo != 0)
- {
- currentEnd = chislo % 10;
- chislo = chislo / 10;
- chisloC2 = chisloC1;
- while (chisloC2 != 0)
- {
- temporaryEnd = chisloC2 % 10;
- chisloC2 = chisloC2 / 10;
- if (currentEnd == temporaryEnd)
- {
- counter++;
- }
- }
- if (counter < count)
- {
- cout << "Loshara!";
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement