2042:【例5.10】稀疏矩阵
作者:互联网
#include<iostream> #include<cstdio> #include<cstdlib> #include<cmath> using namespace std; int main() { int a[100][100],n,m; cin>>n>>m; for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { cin>>a[i][j]; } } for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { if(a[i][j]!=0) cout<<i<<" "<<j<<" "<<a[i][j]<<endl; } } return 0; }
标签:std,main,2042,int,矩阵,5.10,100,include 来源: https://www.cnblogs.com/zheng1945/p/16298549.html