Answer the question
In order to leave comments, you need to log in
How is the program compiled?
Hi people! Now at the University we are going through the basics of c ++, and I came across these tasks:
In principle, I understand the basics of c ++, I solve many mathematical tasks. But, this is generally without concepts, I can not understand how to implement it? Looking forward to your help friends!
Answer the question
In order to leave comments, you need to log in
a) If I understand correctly, then in the first one you just need to make a loop that will count your example by constantly substituting n, and multiplying it by the answer received earlier. It works like a factorial, but instead of !4 = 1*2*3*4, we substitute the example a and already n into it.
long float ans = 1;
for(int i=1; i <= 10; i++) {
ans *= "Ваш пример"
}
long float ans = 1;
for(int i=1; i <= 10; i++) {
long double tmp = 0;
for(int m=1;m <=11; m++) {
tmp += "Ваш пример"
}
ans *= tmp;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question