Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- float F(float x) {
- if (x - 1 == 1) {
- return 0;
- }
- else if (x - 1 < 1) {
- return 1;
- }
- else if (x - 1 > 1) {
- return -1;
- }
- }
- void F(float x, float& y) {
- if (x - 1 == 1) {
- y = 0;
- cout << y;
- }
- else if (x - 1 < 1) {
- y = 1;
- cout << y;
- }
- else if (x - 1 > 1) {
- y = -1;
- cout << y;
- }
- }
- int main() {
- for (float i = 1.0; i < 4; i++) {
- cout << F(i) << " ";
- float y = 0;
- F(i, y);
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement