mardi 31 mars 2015

Create matrix in c++. FOR statement alternative

I am trying to create a matrix in C++. I am a beginner. Is there any other simple way to done this? I am refering to the for statement which uses cin (something like for (i,j=1; i,j<=n; i,j++) or cin >> a;)



int n=5;
int a[n][n];

for(int i=1; i<=n; i++) {
for(int j=1; j<=n; j++) {
cin >> a[i][j];
}
}


Thanks!


Aucun commentaire:

Enregistrer un commentaire