Advertisement
hopingsteam

Untitled

May 4th, 2020
1,220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include    <iostream>
  2. #include    <fstream>
  3.  
  4. using namespace std;
  5.  
  6. ifstream fin("fisier.in");
  7. /*
  8.  * Numar prim
  9.  * CMMDC
  10.  * Factori primi
  11.  * Descompunerea unui nr in cifre (suma, palindrom, ...)
  12.  * Fibonacci
  13.  * Vectori (inserare, stergere, ...)
  14.  * Matrici (parcurgere pe coloane)
  15.  */
  16.  
  17. int main()
  18. {
  19.     unsigned int mat[21][21];
  20.     unsigned int n, k;
  21.     fin >> n >> k;
  22.     for(int i = 1; i <= n; i++)
  23.         for(int j = 1; j <= n; j++)
  24.             fin >> mat[i][j];
  25.  
  26.     unsigned int primaVal = mat[k][1];
  27.     for(int j = 1; j < k - 1; j++)
  28.         mat[k][j] = mat[k][j + 1];
  29.     mat[k][k - 1] = primaVal;
  30.    
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement