fork download
  1. string random_name()
  2. {
  3. string str_four;
  4. srand(time(NULL));
  5. int x = rand() % 3 + 1;
  6. switch (x)
  7. {
  8. case 1:
  9. {
  10. string str_one = "The ";
  11. srand(time(NULL));
  12. int x1 = rand() % 3 + 1;
  13. switch (x1)
  14. {
  15. case 1:
  16. {
  17. string str_two = "fallen ";
  18. srand(time(NULL));
  19. int x2 = rand() % 3 + 1;
  20. switch (x2)
  21. {
  22. case 1:
  23. {
  24. string str_three = "of Gondolin";
  25. str_four = str_one + str_two + str_three;
  26. break;
  27. }
  28. case 2:
  29. {
  30. string str_three = "King Arthur";
  31. str_four = str_one + str_two + str_three;
  32. break;
  33. }
  34. case 3:
  35. {
  36. string str_three = "London bridge";
  37. str_four = str_one + str_two + str_three;
  38. break;
  39. }
  40. default:
  41. break;
  42. }
  43. break;
  44. }
  45. case 2:
  46. {
  47. string str_two = "Hobbit ";
  48. srand(time(NULL));
  49. int x2 = rand() % 3 + 1;
  50. switch (x2)
  51. {
  52. case 1:
  53. {
  54. string str_three = "An unexpected journey";
  55. str_four = str_one + str_two + str_three;
  56. break;
  57. }
  58. case 2:
  59. {
  60. string str_three = "The Desolation of Smaug";
  61. str_four = str_one + str_two + str_three;
  62. break;
  63. }
  64. case 3:
  65. {
  66. string str_three = "Battle of the Five Armies";
  67. str_four = str_one + str_two + str_three;
  68. break;
  69. }
  70. default:
  71. break;
  72. }
  73. break;
  74. }
  75. case 3:
  76. {
  77. string str_two = "Great ";
  78. srand(time(NULL));
  79. int x2 = rand() % 3 + 1;
  80. switch (x2)
  81. {
  82. case 1:
  83. {
  84. string str_three = "Gatsby";
  85. str_four = str_one + str_two + str_three;
  86. break;
  87. }
  88. case 2:
  89. {
  90. string str_three = "Sword of Gandalf";
  91. str_four = str_one + str_two + str_three;
  92. break;
  93. }
  94. case 3:
  95. {
  96. string str_three = "Live";
  97. str_four = str_one + str_two + str_three;
  98. break;
  99. }
  100. default:
  101. break;
  102. }
  103. break;
  104. }
  105. default:
  106. break;
  107. }
  108. break;
  109. }
  110. case 2:
  111. {
  112. string str_one = "Live ";
  113. srand(time(NULL));
  114. int x1 = rand() % 3 + 1;
  115. switch (x1)
  116. {
  117. case 1:
  118. {
  119. string str_two = "one ";
  120. srand(time(NULL));
  121. int x2 = rand() % 3 + 1;
  122. switch (x2)
  123. {
  124. case 1:
  125. {
  126. string str_three = "man";
  127. str_four = str_one + str_two + str_three;
  128. break;
  129. }
  130. case 2:
  131. {
  132. string str_three = "cat";
  133. str_four = str_one + str_two + str_three;
  134. break;
  135. }
  136. case 3:
  137. {
  138. string str_three = "pirate";
  139. str_four = str_one + str_two + str_three;
  140. break;
  141. }
  142. default:
  143. break;
  144. }
  145. break;
  146. }
  147. case 2:
  148. {
  149. string str_two = "in ";
  150. srand(time(NULL));
  151. int x2 = rand() % 3 + 1;
  152. switch (x2)
  153. {
  154. case 1:
  155. {
  156. string str_three = "1888";
  157. str_four = str_one + str_two + str_three;
  158. break;
  159. }
  160. case 2:
  161. {
  162. string str_three = "New York";
  163. str_four = str_one + str_two + str_three;
  164. break;
  165. }
  166. case 3:
  167. {
  168. string str_three = "London";
  169. str_four = str_one + str_two + str_three;
  170. break;
  171. }
  172. default:
  173. break;
  174. }
  175. break;
  176. }
  177. case 3:
  178. {
  179. string str_two = "is ";
  180. srand(time(NULL));
  181. int x2 = rand() % 3 + 1;
  182. switch (x2)
  183. {
  184. case 1:
  185. {
  186. string str_three = "life is a terrible thing";
  187. str_four = str_one + str_two + str_three;
  188. break;
  189. }
  190. case 2:
  191. {
  192. string str_three = "hard";
  193. str_four = str_one + str_two + str_three;
  194. break;
  195. }
  196. case 3:
  197. {
  198. string str_three = "fun";
  199. str_four = str_one + str_two + str_three;
  200. break;
  201. }
  202. default:
  203. break;
  204. }
  205. break;
  206. }
  207. default:
  208. break;
  209. }
  210. break;
  211. }
  212. case 3:
  213. {
  214. string str_one = "Encyclopedia ";
  215. srand(time(NULL));
  216. int x1 = rand() % 3 + 1;
  217. switch (x1)
  218. {
  219. case 1:
  220. {
  221. string str_two = "of ";
  222. srand(time(NULL));
  223. int x2 = rand() % 3 + 1;
  224. switch (x2)
  225. {
  226. case 1:
  227. {
  228. string str_three = "Philosophy";
  229. str_four = str_one + str_two + str_three;
  230. break;
  231. }
  232. case 2:
  233. {
  234. string str_three = "Mathematics";
  235. str_four = str_one + str_two + str_three;
  236. break;
  237. }
  238. case 3:
  239. {
  240. string str_three = "Physics";
  241. str_four = str_one + str_two + str_three;
  242. break;
  243. }
  244. default:
  245. break;
  246. }
  247. break;
  248. }
  249. case 2:
  250. {
  251. string str_two = "for ";
  252. srand(time(NULL));
  253. int x2 = rand() % 3 + 1;
  254. switch (x2)
  255. {
  256. case 1:
  257. {
  258. string str_three = "Children";
  259. str_four = str_one + str_two + str_three;
  260. break;
  261. }
  262. case 2:
  263. {
  264. string str_three = "kids";
  265. str_four = str_one + str_two + str_three;
  266. break;
  267. }
  268. case 3:
  269. {
  270. string str_three = "Everyday Life";
  271. str_four = str_one + str_two + str_three;
  272. break;
  273. }
  274. default:
  275. break;
  276. }
  277. break;
  278. }
  279. case 3:
  280. {
  281. string str_two = "then ";
  282. srand(time(NULL));
  283. int x2 = rand() % 3 + 1;
  284. switch (x2)
  285. {
  286. case 1:
  287. {
  288. string str_three = "Dota 2";
  289. str_four = str_one + str_two + str_three;
  290. break;
  291. }
  292. case 2:
  293. {
  294. string str_three = "CS 1.6";
  295. str_four = str_one + str_two + str_three;
  296. break;
  297. }
  298. case 3:
  299. {
  300. string str_three = "LOL";
  301. str_four = str_one + str_two + str_three;
  302. break;
  303. }
  304. default:
  305. break;
  306. }
  307. break;
  308. }
  309. default:
  310. break;
  311. }
  312.  
  313. }
  314. default:
  315. break;
  316. }
  317. return str_four;
  318. }
  319. int main()
  320. {
  321. setlocale(LC_ALL, "Russian");
  322. srand(time(NULL));
  323. cout << random_name() << "\n";
  324. system("pause");
  325. return 0;
  326. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: ‘string’ does not name a type
 string random_name()
 ^~~~~~
prog.cpp: In function ‘int main()’:
prog.cpp:321:12: error: ‘LC_ALL’ was not declared in this scope
  setlocale(LC_ALL, "Russian");
            ^~~~~~
prog.cpp:321:29: error: ‘setlocale’ was not declared in this scope
  setlocale(LC_ALL, "Russian");
                             ^
prog.cpp:322:13: error: ‘NULL’ was not declared in this scope
  srand(time(NULL));
             ^~~~
prog.cpp:322:17: error: ‘time’ was not declared in this scope
  srand(time(NULL));
                 ^
prog.cpp:322:18: error: ‘srand’ was not declared in this scope
  srand(time(NULL));
                  ^
prog.cpp:323:2: error: ‘cout’ was not declared in this scope
  cout << random_name() << "\n";
  ^~~~
prog.cpp:323:22: error: ‘random_name’ was not declared in this scope
  cout << random_name() << "\n";
                      ^
prog.cpp:324:16: error: ‘system’ was not declared in this scope
  system("pause");
                ^
stdout
Standard output is empty