• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

a guest Dec 16th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. 92.4
2. #include<iostream>
3. #include<math.h>
4. using namespace std;
5.
6. const int N = 1e4;
7.
8. bool used[N][N];
9.
10. int a[N][N];
11. int b[N];
12. int sz;//size
13. int n;
14. void BitToRigth(int k)
15. {
16.     for (int j = sz; j > k; j--)
17.         for (int i = 0; i < n; ++i)
18.             a[i][j] = a[i][j - 1]; // ΡΠ°ΡΡΠΈΡΠ΅Π½ΠΈΠ΅ ΠΌΠ°ΡΡΠΈΠ²Π°
19. }
20. void PushToCow(int k)
21. {
22.     for (int i = 0; i < n; ++i)
23.         a[i][k] = b[i]; // Π²ΡΡΠ°Π²ΠΊΠ° Π½ΠΎΠ²ΠΎΠ³ΠΎ ΡΡΠΎΠ»Π±ΡΠ°
24. }
25. int main()
26. {
27.     cout << "n = ";
28.     cin >> n;
29.     sz = n;
30.     cout << "Matrix = \n";
31.     for (int i = 0; i < n; ++i)
32.         for (int j = 0; j < n; ++j)
33.             cin >> a[i][j];
34.     cout << "vvedite 4islo ";
35.     int g;
36.     cin >> g;
37.     cout << "vvedite massiv vstavki \n";
38.     for (int i = 0; i < n; ++i)
39.         cin >> b[i];
40.     for (int j = 0; j < sz; j++)
41.         for (int i = 0; i < n; ++i) // ΠΏΡΠΎΡΠΎΠ΄ ΠΏΠΎ ΡΡΠ°Π½ΡΠΏΠΎΠ½ΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠΌΡ ΠΌΠ°ΡΡΠΈΠ²Ρ
42.             if (a[i][j] == g)
43.                 {
44.                     BitToRigth(j);
45.                     PushToCow(j);
46.                     sz++; // ΡΠ²Π΅Π»ΠΈΡΠ΅Π½ΠΈΠ΅ ΡΠ°Π·ΠΌΠ΅ΡΠ½ΠΎΡΡΠΈ ΠΌΠ°ΡΡΠΈΠ²Π°
47.                     j++;
48.                     break;
49.                 }
50.
51.     for (int i = 0; i < n; ++i)
52.     {
53.         for (int j = 0; j < sz; ++j)
54.             cout << a[i][j] << ' ';
55.         cout << endl;
56.     }
57. system ("pause");
58. return 0;}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Not a member of Pastebin yet?