Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. // ConsoleApplication9.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <math.h>
  6. #include <stdio.h>
  7.  
  8.  
  9. int n;
  10.  
  11. double wylicz_punkt(double xp, double xk, double x)
  12. {
  13. for (int i; i < n; i++)
  14. {
  15. x = xp + (i / n) * (xk - xp);
  16. return x;
  17. }
  18.  
  19. }
  20.  
  21. double odl_punkt(double xp, double xk, double dx)
  22. {
  23. dx = (xk - xp) / n;
  24. }
  25.  
  26. double licz_funkcje(double f, double x)
  27. {
  28. for (int i; i < n; i++)
  29. {
  30. f = x ^ 2 + 3 * x + 9;
  31. }
  32. return f;
  33.  
  34. }
  35.  
  36. double licz_sume(double S, double dx, double f)
  37. {
  38. for (int i; i < n; i++)
  39. {
  40. S = dx * (S + f);
  41.  
  42. }
  43. return S;
  44.  
  45. }
  46.  
  47. int main()
  48. {
  49. int xp, int x, int xk;
  50.  
  51. printf("podaj xp = %lf", xp);
  52. scanf("%lf", &xp);
  53.  
  54. printf("podaj xk = %lf", xk);
  55. scanf("%lf", &xk);
  56.  
  57. wylicz_punkt();
  58. odl_punkt();
  59. licz_funkcje();
  60. licz_sume();
  61.  
  62. printf("S = %lf", S);
  63.  
  64. return 0;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement