Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // massiv.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- void mas_db(double *mas, double *new_mas);
- int main()
- {
- double mas[10] = {0.1,1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.0};
- double new_mas[10];
- mas_db(mas, new_mas);
- for (int i = 0; i < 10; i++) {
- cout << mas[i] << " ";
- }
- cout << endl;
- for (int i = 0; i < 10; i++) {
- cout << new_mas[i] << " ";
- }
- system("pause");
- return 0;
- }
- void mas_db(double *mas, double *new_mas) {
- for (int i = 0; i < 9; i++) {
- new_mas[i + 1] = mas[i];
- }
- new_mas[0] = mas[9];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement