Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- double fTrojkatna(double x)
- {
- if (x<=0.5)
- {
- return(2*x);
- }
- else
- {
- return((-2*x)+2);
- }
- }
- int main()
- {
- double liczba=10.3;
- liczba=liczba-floor(liczba);
- 1 printf("Wynik:%f", fTrojkatna(liczba));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement