fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <stdbool.h>
  4.  
  5. bool porownaj(double a, double b)
  6. {
  7. const double eps=1e-9;
  8. return fabs(a-b) < eps;
  9. }
  10.  
  11. // punkty ze strony: http://m...content-available-to-author-only...z.pl/strona/2510.html --> sa WSPOLINIOWE
  12. void wyznacznik()
  13. {
  14. float x1=2, y1=1, x2=4, y2=5, x3=-3, y3=-9;
  15. float det = (x1*y2*1.0) + (y1*1.0*x3) + (1.0*x2*y3);
  16. printf("WYSZEDL MI NIEPOPRAWNY DET=%f\nMUSZE SPRAWDZIC ROWNANIA BO SA DO BANI\n",det);
  17. if(porownaj(fabs(det), 0.0))
  18. printf("pkty wspoliniowe\n");
  19. }
  20.  
  21. int main()
  22. {
  23. wyznacznik();
  24. return 0;
  25. }
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
WYSZEDL MI NIEPOPRAWNY DET=-29.000000
MUSZE SPRAWDZIC ROWNANIA BO SA DO BANI