Advertisement
bogdan2004333

Untitled

Oct 4th, 2022 (edited)
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <locale.h>
  3. #include <math.h>
  4. int main() {
  5.     setlocale(0, "");
  6.     double s1,S=1,a;
  7.     fflush(stdout);
  8.     printf("Введите значение а:\n");
  9.     scanf("%lf",&a);
  10.     if(a>=0){
  11.     for(int i=2;i<=8;i+=2){
  12.         s1=pow(i,2);
  13.         S*=s1;
  14.     }S-=a;
  15.     printf("%.7lf",S);}
  16.     else{
  17.     for(int i=3;i<=9;i+=3){
  18.             s1 =pow(i,2)-a;
  19.             S *= s1;
  20.  
  21.     }printf("%lf",S);}
  22.  
  23.  
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement