#include <iostream> #include <cstdlib> #include <ctime> int main() { using namespace std; cout << "Enter size of array: "; int N; cin >> N; int * ARR = new int[N]; srand(time(0)); int i; for (i = 0; i < N; ++i) ARR[i] = rand() % 100 + 1;
cout << "Here is an original array:\n"; for (i = 0; i < N; ++i) cout << ARR[i] << " "; cout << endl;
int temp = ARR[N - 1]; for (i = N - 1; i > 0; --i) ARR[i] = ARR[i - 1]; ARR[0] = temp;
cout << "\nHere is a new array:\n"; for (i = 0; i < N; ++i) cout << ARR[i] << " "; cout << endl;
#include <cstdlib>
#include <ctime>
int main()
{
using namespace std;
cout << "Enter size of array: ";
int N;
cin >> N;
int * ARR = new int[N];
srand(time(0));
int i;
for (i = 0; i < N; ++i)
ARR[i] = rand() % 100 + 1;
cout << "Here is an original array:\n";
for (i = 0; i < N; ++i)
cout << ARR[i] << " ";
cout << endl;
int temp = ARR[N - 1];
for (i = N - 1; i > 0; --i)
ARR[i] = ARR[i - 1];
ARR[0] = temp;
cout << "\nHere is a new array:\n";
for (i = 0; i < N; ++i)
cout << ARR[i] << " ";
cout << endl;
return 0;
}
uses graphABC;
Begin
Setbrushstyle(bsClear);
SetPenWidth(13);
SetPenColor(clBlue);
Circle (140,200,100);
SetPenColor(clBlack);
Circle (320,200,100);
SetPenColor(clRed);
Circle (500,200,100);
SetPenColor(clYellow);
Circle (240,315,100);
SetPenColor(clGreen);
Circle (420,315,100);
SetPenColor(clBlue);
Arc(140,200,100,-17,90);
SetPenColor(clBlack);
Arc(320,200,100,180,200);
SetPenColor(clBlack);
Arc(320,200,100,-15,90);
SetPenColor(clRed);
Arc(500,200,100,180,270);
SetPenColor(clYellow);
Arc (240,315,100,0,45)
end.
Объяснение:
картинка