Jump to content

[C++]Scrierea si Citirea unei matrici intr-un subprogram


FnZ
 Share

Recommended Posts

/*Matrice C++ alaturi de fisier de iesire + intrare si consola*/
//=======================Includes======================
#include <iostream>
#include <fstream>

using namespace std;

void Program()
{
    int n,i,j,k,M[15][15];
    ifstream f ("matrice.in");
    ifstream t ("matrice2.in");
    ofstream g ("matrice.txt");
    cout<< "Alege dimensiunea matricii:";
    f>>n;
    cout<<endl;
    cout << "Ai ales cu succes dimensiunesa matrcii:"<<" "<<n<<endl;
    for (i=0; i<k; i++)
    {
        for(j=0; j<k; j++)
        {
            t>>M[i][j];
        }
    }
    for (i=0; i<k; i++)
    {
        for(j=0; j<k; j++)
        {
            g<<M[i][j]<<" ";
        }
    }
}


int main()
{
    Program();
    return 0;
}

Mult Succes~!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.