Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <string>
- using namespace std;
- string CharsToString(char a, char b, char c, char d);
- int main(int argc, char** argv) {
- setlocale(LC_ALL,"");
- char abcd[4] = {'a','b','c','d'};
- vector<char> cv;
- for(int i=0; i<4; i++){
- cv.push_back(abcd[i]);
- for(int j=0; j<4; j++){
- cv.push_back(abcd[j]);
- for(int k=0; k<4; k++){
- cv.push_back(abcd[k]);
- for(int l=0; l<4; l++){
- cv.push_back(abcd[l]);
- }
- }
- }
- }
- vector<string> csv;
- int sum = 0;
- for(int i = 0; i<cv.size(); i++){
- if((i)%4==0){
- string newS = CharsToString(cv[i],cv[i+1],cv[i+2],cv[i+3]);
- csv.push_back(newS);
- cout << newS << endl;
- }
- }
- if ( find(csv.begin(), csv.end(), "aaaa") != csv.end() )
- cout << "Létezik!" << endl;
- else
- cout << "Nem létezik!" << endl;
- return 0;
- }
- string CharsToString(char a, char b, char c, char d){
- string aS;
- aS.push_back(a);
- string bS;
- bS.push_back(b);
- string cS;
- cS.push_back(c);
- string dS;
- dS.push_back(d);
- return aS+bS+cS+dS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement