Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <stdlib.h>
- #include <string.h>
- #include <time.h>
- #include <algorithm>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- using namespace std;
- int main(int argc, char *argv[]) {
- int x=0, i, b;
- string g[100];
- string t;
- cout<<"Ponha ai nomes do que quiser e este programa fara uma lista aleatoria"
- <<", isto pode ser util se estiver indeciso/a sobre o que fazer e pode introduzir ate 100 elementos."
- <<"Quando quiser parar basta escrever 'DONE' ";
- for(i=0; i<100; i++)
- {
- cout<<"\nIntroduza o nome de um jogo "<<i+1<<": ";
- cin>>t;
- if(t == "DONE")
- break;
- g[i]=t;
- x=i;
- }
- srand ( time (NULL));
- for(int j=0; j<3; j++)
- {
- int lol = rand() % x;
- cout<<"\n Jogo "<<j+1<<" : "<<g[lol]<<"\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment