Witam!
Czy mógłby mi ktos poradzic co mam źle w programie?
Chce stworzyc macierz skladajaca sie z liczb zespolonych. Pierwszy raz bawie sie w struktury.
#include <iostream>
using namespace std;
const int mmax = 100;
const int nmax = 100;
int main()
{
int m,n,i,j;
float A[mmax][nmax];
struct zespolona
{
float re,im;
};
cout << "Podaj ile wierszy ma miec macierz:" << endl;
cin >> m;
cout << "Podaj ile kolumn ma miec macierz:" << endl;
cin >> n;
for(i=0;i<m;i++)
for(j=0;j<n;j++)
{
cout << "Podaj element [" << i+1 << "]["<<j+1<<"]:" << endl;
cin >> A[i][j].re;
cin >> A[i][j].im;
}
cout << "Macierz liczb zespolonych ma postac:" << endl;
for(i=0;i<m;i++)
{for(j=0;j<n;j++)
cout << A[i][j].re << "+" << A[i][j].im <<"i" << endl;
}
return 0;
}