Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main()
- {
- srand (time(0));
- int tab[5][10];
- int k, l, x, w, n;
- cout<<"Tablica 5 x 10:\n\n";
- for (k=0; k<=4; k++)
- {
- cout<<"\t";
- for (l=0; l<=9; l++)
- {
- tab[k][l]=rand()%101;
- cout<<tab[k][l]<<" ";
- }
- cout<<endl;
- }
- cout<<"\n\nPodaj nr kolumny (od 1 do 10):\n";
- cin>>x;
- x=x-1;
- for (n=0; n<=4; n++)
- {
- if (tab[n][x]>=tab[n+1][x]) w=tab[n][x];
- else w=tab[n+1][x];
- }
- cout<<"\nnajwieksza wartosc dla podanej kolumny wynosi: "<<w;
- return 2013;
- }
Advertisement
Add Comment
Please, Sign In to add comment