Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <ctime>
- using namespace std;
- int main(){
- srand(time(NULL));
- int dim = rand()%4+2, dim_array = rand()%10+2, c=0, v=0, i=0, j=0, k=0, count=0;
- dim = dim*2;
- cout << "Dimensione parola " << endl;
- string parola[dim];
- string parole_array[dim_array];
- cout << "Dimensione array di parole " << parole_array << endl;
- string cons[22]={"b","c","d","f","g","h","l","m","n","p","q","r","s","t","v","z","j","y","k","x","w"};
- string vocali[5]= {"a","e","i","o","u"};
- string suffisso = "ba";
- while(j<dim_array){
- while(i<dim){
- c = rand()%22;
- v = rand()%5;
- parola[i] = cons[c];
- parola[i+1] = vocali[v];
- i = i+2;
- }
- parole_array[j] = parola;
- }
- //cout << "La stringa ricercata risulta trovata n°" << count << " volte." << endl;
- system("PAUSE");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement