Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //3. uloha
- int kontrolaPovolenychZnakov(const string &vstup, const string &povoleneZnaky) {
- if (vstup== "" ) {
- return -1;
- }
- if(povoleneZnaky == ""){
- return 0;
- }
- int i = 0;
- bool tmp;
- while (vstup[i] != '\0') {
- tmp = false;
- for (int j = 0; j < povoleneZnaky.size(); j++) {
- if (vstup[i] == povoleneZnaky[j]) {
- tmp = true;
- break;
- }
- }
- if (tmp == false) {
- return i;
- }
- i++;
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement