Answer the question
In order to leave comments, you need to log in
What is strange about the cycle?
#include <fstream>
using namespace std;
char a[100][100];
int i,j,m,n,r;
main()
{
ifstream in("input.txt");
ofstream out("output.txt");
in>>m>>n;
for (;i<m; i++)
for (;j<n; j++)
in>>a[i][j];
}
Answer the question
In order to leave comments, you need to log in
What do you mean ignored? It's just that after the first execution of the inner loop, j will remain equal to n, and therefore the inner loop will be executed only once. (it's still lucky that in C++ global variables are initialized to zero)
And all because my mother told me to declare variables as close as possible to the place of use :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question