//FIRST
#include <iostream>
using namespace std;
int main()
{
int n1;//Первый элемент
cin>>n1;
int step;//Шаг прогрессии
cin>>step;
int quantity;//Какой элемент найти
cin>>quantity;
cout<<n1+ (quantity-1)*step;
return 0;
}
//
//SECOND
//Использовал STL
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
srand(time(NULL));
int n;
cin>>n;
vector<int>arr(n);
for(int i = 0;i<n;i++){
arr[i]=rand()%100;
}
sort(arr.begin(), arr.end());
cout<<arr[n-1];
return 0;
}
//4 - X3
type
Товар = class
public
Наименование: string;
Стоимость: real;
СрокГодности: integer;
Производитель: string;
constructor (Наим: string; Стоим: real; Срок: integer; Произв: string);
begin
Наименование := Наим;
Стоимость := Стоим;
СрокГодности := Срок;
Производитель := Произв;
end;
function ToString: string; override;
begin
Result := $'{Наименование}, {Стоимость}, {СрокГодности}, {Производитель}'
end;
end;
begin
var t1 := new Товар('Конфетка',250.6,24,'Артелька');
var t2 := new Товар;
t2.Наименование := 'Печенька';
t2.Стоимость := 79;
t2.СрокГодности := 36;
Println(t1);
Println(t2)
end.