Задача:
Код программы:
#include <stdio.h>
#include <math.h>
#include <conio.h>
int fun(int);
void main()
{
clrscr();
int n;
float p;
printf ("введите N=");
scanf ("%i", &n);
if(n >= 5)
{
p = (fun(n)) + 4;
p = pow(p, 3);
}
else
p = sin(fun(n));
printf("P = %f", p);
getch();
}
// функция
int fun(int x)
{
if(x == 1 || x == 0)
return 1;
else
return x*fun(x-1);
}
Результат:

Комментариев нет:
Отправить комментарий