Advertisement
anon20016

Untitled

Dec 12th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <vector>
  3. #include <iostream>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. double a[100];
  11. int n;
  12. cin >> n;
  13. for (int i = 0; i < n; i++) {
  14. cin >> a[i];
  15. }
  16. double c[100][100];
  17. for (int i = 0; i < n; i++) {
  18. int t = 0;
  19. for (int j = i; j < n; j++) {
  20. c[i][t] = a[j];
  21. t++;
  22. }
  23. for (int j = 0; j < i; j++) {
  24. c[i][t] = a[j];
  25. t++;
  26. }
  27. }
  28. for (int i = 0; i < n; i++) {
  29. for (int j = 0; j < n; j++) {
  30. cout << c[i][j] << ' ';
  31. }
  32. cout << endl;
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement