Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a[100][100],n,m,i,j,nr=0,cop;
- cout<<"n= ";cin>>n;
- cout<<"m= ";cin>>m;
- for (i=1;i<=n;i++)
- for (j=1;j<=m;j++)
- {
- cout<<"a["<<i<<"]["<<j<<"]= ";
- cin>>a[i][j];
- cop=a[i][j];
- while (cop)
- {nr=nr*10+cop%10;
- cop=cop/10;
- }
- if (nr==a[i][j])
- a[i][j]=a[i][j];
- else
- a[i][j]=0;
- nr=0;
- }
- for (i=1;i<=n;i++)
- {for (j=1;j<=m;j++)
- cout<<a[i][j]<<" ";
- cout<<'\n';
- }
- return 0;
- }
- // Vineri metode de sortare vectori + test matrice.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement