Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- float tab[100][100];
- int n,m,iloczyn=-9999,suma=9999,t,sun,ilm;
- cout<<"podaj ilosc wierszy: ";
- cin>>n;
- cout<<"podaj ilosc kolumn: ";
- cin>>m;
- for(int i=0;i<n;i++)
- {
- for(int j=0;j<m;j++)
- {
- cout<<"Podaj wartosc o wspolrzednych "<<i<<","<<j<<": ";
- cin>>tab[i][j];
- }
- }
- for(int i=0;i<n;i++)
- {
- for(int j=0;j<m;j++)
- {
- cout<<tab[i][j]<<"\t";
- }
- cout<<"\n";
- }
- for(int i=0;i<m;i++)
- {
- t=tab[0][i]*tab[1][i];
- if(t>iloczyn)
- {
- iloczyn=t;
- ilm=i;
- }
- }
- for(int i=0;i<n;i++)
- {
- t=tab[i][0]+tab[i][1]+tab[i][2];
- if(t>suma)
- {
- suma=t;
- sun=i;
- }
- }
- cout<<"Najwiekszy iloczyn: "<<tab[0][ilm]<<","<<tab[1][ilm]<<endl;
- cout<<"Najwieksza suma: "<<tab[sun][0]<<","<<tab[sun][1]<<","<<tab[sun][2]<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement