Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int funkcja_liniowa(int a, int b)
- {
- float w_y;
- cout << "Wykres funkcji liniowej (y=ax+b)" << endl;
- for (int y = 15; y >= -15; y--)
- {
- for (int x = -50; x <= 50; x++)
- {
- w_y = a*x + b;
- if (w_y == y)
- cout << "x";
- else if (x == 0 && y == 0)
- cout << "+";
- else if (y == 0)
- cout << "-";
- else if (x == 0)
- cout << "|";
- else
- cout << " ";
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement