Guest User

Untitled

a guest
Mar 24th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  5.     using namespace std;
  6. int main(int argc, char** argv) {
  7.    
  8.     cout<<"Wpisz ile rzeczy chcialbys miec: ";
  9.     int ilosc;
  10.     cin>>ilosc;
  11.     string rzecz[ilosc];
  12.     int tablica[ilosc];
  13.     while(ilosc!=0)
  14.     {
  15.         cout<<"Co chcesz miec? ["<<ilosc<<"] pozostalo: ";
  16.        
  17.         cin>>rzecz[ilosc];
  18.         ilosc--;
  19.     }
  20.     tablica[ilosc];
  21.     srand(time(NULL));
  22.     int losuj;
  23.     while(tablica[ilosc]!=ilosc)
  24.     {
  25.         losuj=rand()%100+1;
  26.         cout<<"Prawdopodobienstwo ze bedziesz mial "<<rzecz[ilosc]<<" jest rowne "<<endl;
  27.         ilosc++;
  28.     }
  29.  
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment