Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.  
  7. const char* exclamation[4] = { "SHOK", "SKANDAL", "NECHUVANA NAGLOST" };
  8. const char* object[6] = { "Rqpa", "Baba", "Kmet", "Bager", "Sklad" };
  9. bool objectandsubject[][6] = { { true, true },
  10. { true, true },
  11. { true, true },
  12. { true, true },
  13. { true, false },
  14. };
  15. const char* action[6] = { "sgazi", "zadiga", "namiga na", "precakva", "tarashi" };
  16. char exclamationMark;
  17. const char* subject;
  18. // char* exclamation, subject, exclamationMark = {}, object, action;
  19. int n;
  20. cout << "Enter number of headings: ";
  21. cin >> n;
  22.  
  23. int numofExclamationMarks;
  24. int temp;
  25. for (int i = 0; i < n; i++){
  26. exclamationMark = {};
  27. *exclamation = exclamation[(int)rand()*strlen(*exclamation - 1)];
  28. numofExclamationMarks = (int)(1 + rand() * 5);
  29. for (int j = 0; j < numofExclamationMarks; j++)
  30. exclamationMark += '!';
  31. *action = action[(int)(rand()*strlen(*action - 1))];
  32. do{
  33. temp = (int)(rand()*strlen(*object - 1));
  34. } while (objectandsubject[temp][1] == false);
  35. subject = object[temp];
  36. do{
  37. (int)(rand()*strlen(*object - 1));
  38. } while (objectandsubject[temp][0] == false);
  39. //object& = *object[temp];
  40.  
  41. cout << (char)exclamation << " " << exclamationMark << " " << subject << " " << action << " " << object << endl;
  42. }
  43.  
  44.  
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement