#include<iostream>
using namespace std;
bool checkRepeat(int n)
{
int a,flag[100] = { 0 };
while (n)
{
a = n % 10;
n /= 10;
if (flag[a])
return true;
flag[a] = 1;
}
return false;
}
int main()
{
int n;
cin >> n;
cout << checkRepeat(n);//输出1则有重复数字,反之则反。
return 0;
}
数字查重
猜你喜欢
转载自blog.csdn.net/qq_43548474/article/details/88984134
今日推荐
周排行