Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void leer_matriz(int& total, int datos[10][10])
- {
- int MaxLines;
- total = 0;
- ifstream Count("matriz_de_entrada.txt");
- if(!Count.good()) cout<<"ERROR EN LECTURA DE MATRIZ.";
- while(!Count.eof())
- {
- Count>>MaxLines; // ignorar, es solo para mover el cursor de lectura del archivo
- total++;
- }
- MaxLines = int(sqrt(total));
- Count.close();
- ifstream File("matriz_de_entrada.txt");
- if(!File.good()) cout<<"ERROR EN LECTURA DE MATRIZ.";
- for(int I = 0;I < MaxLines;I++)
- {
- for(int J = 0;J < MaxLines;J++)
- {
- File>>datos[I][J];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement