Advertisement
JewishCat

Untitled

Jan 24th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. // massiv.cpp: определяет точку входа для консольного приложения.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6.  
  7. using namespace std;
  8. void mas_db(double *mas, double *new_mas);
  9. int main()
  10. {
  11. double mas[10] = {0.1,1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.0};
  12. double new_mas[10];
  13. mas_db(mas, new_mas);
  14. for (int i = 0; i < 10; i++) {
  15. cout << mas[i] << " ";
  16. }
  17. cout << endl;
  18. for (int i = 0; i < 10; i++) {
  19. cout << new_mas[i] << " ";
  20. }
  21.  
  22. system("pause");
  23. return 0;
  24. }
  25. void mas_db(double *mas, double *new_mas) {
  26.  
  27. for (int i = 0; i < 9; i++) {
  28. new_mas[i + 1] = mas[i];
  29. }
  30. new_mas[0] = mas[9];
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement