Вопрос школьника по предмету Информатика
Напишите программу на C++, которая вычисляет факториал введенного числа
Ответ учителя по предмету Информатика
//Microsoft Visual C++ 2010
#include <iostream>
using namespace std;
int main()
{
int i, n;
long int prod=1;
cin >> n;
for (i=1; i<=n; i++) prod*=i;
cout << prod;
return 0;
}
Похожие вопросы от пользователей
Know, swim, prefer, believe, read, like, jog, include, see, watch
IV. Заполните пропуски, используя / was, were/ is, am, are+Ving.И переведите предложения.
1) When I came home yesterday my brother ______________(watch) sports competitions on TV.
2).Look! What ______ the burglar______ (do) on the roof now?
3) They ______________(not have) their training sessions last week.
4) When I came home yesterday my brother ______________(watch) sports competitions on TV.
5).What book_____you______ (read) at the moment?
6) They _____ _________(not leave) St.Petersburg at 2 pm tomorrow.
7) The offender ___ _____(shout) something, when we entered the bar.