For 12. Дано целое число N (> 0). Найти произведение
\(1.1 \cdot 1.2 \cdot 1.3 \cdot ...\)
(N сомножителей).

Решение на Python 3

import random

N = random.randrange(1,10)
print('N = ', N)

P = 1.0
for i in range(1,N+1):
x = 1 + i*0.1
P *= x
print(i," : ",x," : ",P)
print("Product = ",P)

Решение на C++

#include <bits/stdc++.h>
using namespace std;

int main() {
srand((int)time(0));
int N;
N = rand() % 20;

double p = 1, x;
for(int i = 1; i <= N; i++) {
x = 1 + i*0.1;
p *= x;
cout << i <<" : " << x <<" : " << p << endl;
}
cout << "Number N: " << N << endl;
cout << "Product = " << p << endl;
return 0;
}