Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. int funkcja_liniowa(int a, int b)
  2. {
  3. float w_y;
  4. cout << "Wykres funkcji liniowej (y=ax+b)" << endl;
  5. for (int y = 15; y >= -15; y--)
  6. {
  7. for (int x = -50; x <= 50; x++)
  8. {
  9. w_y = a*x + b;
  10. if (w_y == y)
  11. cout << "x";
  12. else if (x == 0 && y == 0)
  13. cout << "+";
  14. else if (y == 0)
  15. cout << "-";
  16. else if (x == 0)
  17. cout << "|";
  18. else
  19. cout << " ";
  20. }
  21. cout << endl;
  22. }
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement