Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. class parabola
  2. {private:
  3. float a,b,c;
  4. public:
  5. void vvod()
  6. {
  7. printf("Vvedite koeficienti a b c\n");
  8. scanf("%f%f%f",&a,&b,&c);
  9. }
  10. float obrab()
  11. {
  12. float v;
  13. v=-b/(2*a);
  14. return v;
  15. }
  16. void vyvod(float v)
  17. {
  18. if (a>0)
  19. {
  20. printf("ot ");
  21. printf("%1.1f",v);
  22. printf(" do +besconechnosti");
  23. }
  24.  
  25. if (a<0)
  26. {
  27. printf("ot -besconechnosti do ",v);
  28. printf("%1.1f",v);
  29. }
  30. if (a==0)
  31. printf("TK Vi vveli 0 - eto ne parabola ()");
  32.  
  33. } };
  34.  
  35.  
  36.  
  37.  
  38. #include <stdio.h>
  39. #include "File1.h"
  40. #include <conio.h>
  41. //---------------------------------------------------------------------------
  42.  
  43.  
  44. int main()
  45. {
  46. parabola odin;
  47. float v;
  48. odin.vvod();
  49. v=odin.obrab();
  50. odin.vyvod(v);
  51. getch();
  52. return 0;
  53.  
  54.  
  55.  
  56. }
  57. //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement