#include <iostream>
using namespace std;
int main(){
int i=0, j=0;
int students, exams;
cin>>students;
cin>>exams;
int **std = new int* [students];
for(i=0; i<students; i++)
std[i] = new int[exams];
for(i=0; i<students; i++)
for(j=0; j<exams; j++)
std[i][j] = j;
for(i=0; i<students; i++){
for(j=0; j<exams; j++)
cout<<std[i][j];
cout<<endl;
}
if(std){
for(i=0; i<students; i++)
delete[] std[i];
delete[] std;
}
return 0;
}
결과값 :
012 // 출력값들
012
012
012
012
Press any key to continue