Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- const int n(7);
- int Mass[n] = {0,0,0,0,0,0,0};
- int Mass1[n] = {0,0,0,0,0,0,0};
- int sd;
- cout << "Введите число: ";
- cin >> Mass[0];
- for(short int df(0); df <= (n-1); df++)
- {
- Mass[df+1] = Mass[df+1] + (Mass[df] / 10);
- Mass[df] = Mass[df] % 10;
- }
- cout << "Ваше число: " << endl;
- for(int a(6); a >= 0; a--)
- {
- cout << Mass[a];
- }
- cout << endl;
- cout << "Введите сдвиг: ";
- cin >> sd;
- sd = sd%7;
- for(int a(0); a < 7; a++)
- {
- Mass1[(a+sd)%7] = Mass[a];
- }
- cout << "Ответ: " << endl;
- for(int a(6); a >= 0; a--)
- {
- cout << Mass1[a];
- }
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement