Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <iomanip>
  4. #include<time.h>
  5. using namespace std;
  6.  
  7. void losowa_liczba() //da sie wstawic to w tabele?
  8. {
  9. srand( time( NULL ) );
  10. printf( "Wylosowano %d\n", rand() );
  11. }
  12.  
  13. int main()
  14. {
  15. losowa_liczba();
  16.  
  17. int tabA[4][3]={{losowa_liczba()},{4,5,5},{23,4,5},{21,42,53}}; //wydaje mi sie ze jest zla zmienna i nie widzi "liter" //napisu losowa_liczba. ja zrobic zeby stworzyc tablice, ktora wypelnia sie dowolnymi liczbami?
  18.  
  19. for (int i = 0; i<4; i++){
  20. for(int j =0 ; j<3 ;j++)
  21. cout << setw(10) << tabA[i][j];
  22. cout << endl<<endl;
  23. }
  24.  
  25.  
  26.  
  27. //losowa_liczba(),losowa_liczba(),losowa_liczba()
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. system("pause");
  36. return 0;
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement