Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <iostream>
- float x(float valuea, float valueb, float valuec, float i){
- return sqrt((pow(i,2)+valuea+valuec)/valueb*pow(i,2)+i*valuec+valuea);
- }
- float y(float valuea, float valueb, float valuec, float i){
- return valuea*log(valueb*i + valuec)+valueb*pow(i,2);
- }
- float summ(int start, int end, float valuea, float valueb, float valuec, char c, float identify){
- int i;
- float result_returned = 0;
- switch (c)
- {
- case 'x':
- for (i = start; i < end; i++)
- result_returned += x(valuea, valueb, valuec, i)*identify;
- break;
- case 'y':
- for (i = start; i < end; i++)
- result_returned += y(valuea,valueb,valuec,i)*identify;
- }
- return result_returned;
- }
- int main(void){
- float a, b, c;
- float result;
- printf("Введите a,b,c\n");
- scanf_s("%f %f %f",&a,&b,&c);
- result = pow(summ(4, 11, a, b, c, 'x', 1.0), 2) + 0.6*summ(2, 7, a, b, c, 'y', 1.0) + sqrt(summ(6, 10, a, b, c, 'x', 0.2) + summ(3, 5, a, b, c, 'y', 1.0));
- printf("%f\n",result);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement