Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication9.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <math.h>
- #include <stdio.h>
- int n;
- double wylicz_punkt(double xp, double xk, double x)
- {
- for (int i; i < n; i++)
- {
- x = xp + (i / n) * (xk - xp);
- return x;
- }
- }
- double odl_punkt(double xp, double xk, double dx)
- {
- dx = (xk - xp) / n;
- }
- double licz_funkcje(double f, double x)
- {
- for (int i; i < n; i++)
- {
- f = x ^ 2 + 3 * x + 9;
- }
- return f;
- }
- double licz_sume(double S, double dx, double f)
- {
- for (int i; i < n; i++)
- {
- S = dx * (S + f);
- }
- return S;
- }
- int main()
- {
- int xp, int x, int xk;
- printf("podaj xp = %lf", xp);
- scanf("%lf", &xp);
- printf("podaj xk = %lf", xk);
- scanf("%lf", &xk);
- wylicz_punkt();
- odl_punkt();
- licz_funkcje();
- licz_sume();
- printf("S = %lf", S);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement