Advertisement
blackpab

2 z 10

Feb 1st, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.94 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. funkcja_a(int a, int b, int c, int x);
  6. funkcja_b(int a, int b, int x);
  7. funkcja_c(int a, int b, int x);
  8.  
  9.  
  10. int main() {
  11.     int a,b,c,d,x=0;
  12.    
  13.     printf("Podaj a,b,c,d rozdzielajac je spacja:");
  14.     scanf("%d %d %d %d",&a,&b,&c,&d);
  15.     printf("a=%d b=%d c=%d d=%d",a,b,c,d); 
  16.    
  17.     printf("\nPodpunkt a: \n");
  18.     while( funkcja_a( a, b, c, x ) <= d )
  19.     {
  20.         printf("x=%d ", x);
  21.         ++x;
  22.     }  
  23.    
  24.    
  25.     printf("\nPodpunkt b: \n");
  26.     x=0;
  27.     while( funkcja_b( a, b, x ) < c )
  28.     {
  29.         printf("x=%d ", x);
  30.         ++x;
  31.     }  
  32.        
  33.     printf("\nPodpunkt c: \n");
  34.     x=0;
  35.     while( funkcja_b( a, b, x ) <= c )
  36.     {
  37.         printf("x=%d ", x);
  38.         ++x;
  39.     }
  40.        
  41.     return 0;
  42. }
  43.  
  44. funkcja_a(int a, int b, int c, int x)
  45. {
  46.     return fabs(a) * (pow( x, 2 )) + (b*x) + c;
  47. }
  48.  
  49. funkcja_b(int a, int b, int x)
  50. {
  51.     return 5 * (pow( x, 2 )) + (a*x) + b;
  52. }
  53.  
  54. funkcja_c(int a, int b, int x)
  55. {
  56.     return 5 * (pow( x, 2 )) + (a*x) + b;  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement