Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <locale>
- using namespace std;
- void main()
- {
- int x, y, N;
- float k = 0;
- setlocale(LC_ALL, "rus");
- cout << "N?" << endl;
- cin >> N;
- for (int i = 0; i < N; i++)
- {
- cout << "введите x";
- cin >> x;
- cout << "введите y";
- cin >> y;
- if (x*x + y*y <= 1 && -x - 1 <= y) k = k + 1;
- }
- cout<<k / N * 100 << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment