#include #include #include #include using namespace std; double n = 5.0; double epsilon = 0.0001; double mli = 30.0; double dane[] = { 10, 1, 1, 1, 2, 8, 3, 20, 4, 2, 1, 20, 5, 1, 40, 9, 5, -8, 3, 0, 1, 10, 1, -8, 6, 2, 1, 1, 20, -13 }; double macierzA[5][5]; double macierzAlfa[5][5]; double wektor[5]; double wektorBeta[5]; double x_nowy[5], x_stary[5]; int x=0; void funkcja_b() { std::cout << "Macierz alfa"< epsilon && licznik < mli); cout << endl <<"Licznik iteracji " << licznik << endl << " norma3 " << norma3 << endl; } int main() { //wpisywanie do macierzy for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { macierzA[i][j] = dane[x]; //cout << macierzA[i][j] << " "; x++; } wektor[i] = dane[x]; x++; //cout << endl; } funkcja_b(); cout << "Macierz Alfa" << endl; for (int i = 0; i < n; i++){ for (int j = 0; j < n; j++){ cout << macierzA[i][j] << " "; } cout << endl; } cout << endl<< "wektor Beta" << endl; for (int i = 0; i < n; i++){ cout << wektorBeta[i] << endl; } funkcja_c(); getchar(); return 0; }