I do not know where I did wrong: The result is totally wrong.
int main(int argc, char *argv[])
{
cv::Mat a(3,3,CV_32SC1);
a.at<int>(2,2)=5;
for(int i =0; i <a.rows; i++){
for(int j =0; j <a.cols;j++){
cout<<a.at<int>(i,j);
}
}
return 0;
}