Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cmath>
- #define M_PI 3,1415926535
- using namespace std;
- int main()
- {
- long double angle = 0;
- int i = 1, n, x = 0, y = 0;
- ifstream input;
- input.open("INPUT.txt");
- input >> n;
- input.close();
- ofstream output;
- output.open("OUTPUT.txt");
- if (n>0 && n<=300) {
- output << "YES" << endl;
- while (i <= n) {
- x = cos(angle) * 10000;
- y = sin(angle) * 10000;
- output << x << ' ' << y << endl;
- angle += (2 *M_PI) / (n+1);
- ++i;
- }
- }
- else output << "NO" << endl;
- output.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement