Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- bool Check(char* _Array)
- {
- int Temp = -1;
- int Mod[10] = {};
- for (int i = 0; i < strlen(_Array);i++)
- {
- Temp = (_Array[i]) % 10;
- Mod[Temp]++;
- }
- for (auto j : Mod)
- {
- if (j != 1)
- {
- return false;
- }
- }
- return true;
- }
- void main()
- {
- cout << Check("0123456789") << endl;
- cout << Check("01234") << endl;
- cout << Check("01234567890") << endl;
- }
Add Comment
Please, Sign In to add comment