Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream f("date.in");
- ofstream g("date.out");
- int main()
- {
- int a[100][100],i,j,m,n,pc,ogl,cop,con,nr,q;
- f>>m>>n;//m-linii,n-coloane
- for (i=1;i<=n;i++)
- for (j=1;j<=m;j++)
- {
- f>>a[i][j];
- if (j%2==1)
- {
- cop=a[i][j];
- con=0;
- ogl=0;
- while (cop)
- {
- ogl=ogl*10+cop%10;
- cop=cop/10;
- con++;
- }
- pc=ogl%10;
- nr=0;
- for (q=1;q<=con;q++)
- nr=nr*10+pc;
- a[i][j]=nr;
- }
- }
- for (i=1;i<=n;i++)
- {
- for (j=1;j<=m;j++)
- g<<a[i][j]<<" ";
- g<<'\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement