Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <cstdint>
- #include <math.h>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- float x, y;
- cout « endl « " | x |" « "| y |" « endl;
- cout « " |---------|" « "|---------|" « endl;
- for (x=0; x<20; x+=0.25)
- {
- if (x < 2)
- {
- y = 2-x;
- }
- else if (x<4)
- {
- y = 2*(sqrt(1-(x-2)*(x-2)));
- }
- else if ( fmod(x,4) < 2)
- {
- y = 2-(fmod(x,4);
- }
- else if ( fmod(x,4) < 4)
- {
- y = 2*(sqrt(1-((fmod(x,4)-2)*((fmod(x,4)-2)));
- }
- cout « " | "« x « " |" « "| "« y « " |" « endl;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement