#include
using namespace std;
int main()
{
int n;
int k[9];
bool b;
cout << "n = ", cin >> n, cout << "\n";<br> for (int i=0; i<=9; i++) k[i]=0;<br> while (n>0){
k[n % 10]++;
n=n / 10;
}
b=false;
for (int i=0; i<=9;i++) <br> if (k[i]>1) b=true;
if (b) cout << "Да" << "\n";<br> else cout << "Нет" << "\n";<br> return 0;
}
Пример:
n = 12342
Да