#include<iostream>
using namespace std;
int main(){
int N;
int *arr;
cout << "enter size of arr(enter N) : ";
cin >> N;
arr = new int [N];
for(int i = 1; i <= N;i++)
cin >> arr[i];
cout << "your arr : ";
for(int i = 1; i <= N;i++)
cout << arr[i] << " " ;
cout << "new arr : ";
for(int i = N; i > 0;i--)
cout << arr[i] << " " ;
cout << "new2 arr : ";
for(int i = 1; i <= N;i++)
{
if((i % 2) == 0)
cout << arr[i] << " " ;
}
}
Program Goodluck51_1;
uses crt;
var
n,nt,sum,temp: integer;
begin
write('Введите 5-значное число ');
readln(n);
if (n<10000) or (n>99999) then write('Вы ввели неправильное число ')
else
begin
nt:=n;
writeln('*** alphaues is thinking... ***');
writeln('*** OK ***');
while n>=1 do
begin
temp:=n mod 10;
sum := sum + temp;
n := n div 10;
end;
writeln('Сумма цифр числа ',nt,' равна ',sum);
end;
end.
Program Goodluck51__2;
uses crt;
const n=4;
var
a:array[1..n] of real;
lt:array[1..n] of char;
min,max: real;
i:integer;
begin
writeln('*** alphaues is thinking... ***');
writeln('*** OK ***');
lt[1]:='a';
lt[2]:='b';
lt[3]:='c';
lt[4]:='d';
for i:=1 to n do
begin
write('Введите число ',lt[i],'=');
readln(a[i]);
end;
max:=a[1];
min:=a[1];
writeln('Числа: ');
for i:=1 to n do
begin
if a[i] > max then
max:= a[i];
if a[i] < min then
min:=a[i];
writeln(lt[i],'=',a[i]);
end;
writeln('Полусумма наименьшего и наибольшего из них равна',(min+max)/2);
end.
Program Goodluck51_3;
uses crt;
var
n,nt,sum,temp: integer;
begin
write('Введите число ');
readln(n);
nt:=n;
sum:=0;
writeln('*** alphaues is thinking... ***');
writeln('*** OK ***');
while n>=1 do
begin
temp:=n mod 10;
sum := sum + temp;
n := n div 10;
end;
writeln('Сумма цифр числа ',nt,' равна ',sum);
end.
k=17
i=7бит
I=17 * 7 = 119 бит