Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <stdio.h>
- #include <conio.h>
- float GetValueFunction(float a, float b);
- void main()
- {
- float x,y;
- printf("input koordinati /n");
- printf("input x:");
- scanf("%f", &x);
- printf("input y:");
- scanf("%f", &y);
- float k=GetValueFunction(x,y);
- float y1,y2,y3,a;
- y1 = a+2;
- y2=(-a)*2+2;
- y3=0.5*a-1;
- printf("part=%1.0f\n", k);
- getch();
- }
- float GetValueFunction(float a, float b )
- {
- float c=0;
- float y1, y2,y3;
- if ((b <= y1) && (b <= y2) && (b >= y2))
- c = 0;
- else if (b >= (y1) && b >y2)
- c = 1;
- else if (b >= y3)
- c = 6;
- else c = 5;
- else if (b >= y3)
- c = 2;
- else if (b > y2)
- c = 3;
- else c = 4;
- return c;
- }
Add Comment
Please, Sign In to add comment