ChameL1oN

лаба 2 Мар

Jun 17th, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <locale>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. void main()
  9. {
  10. int x, y, N;
  11. float k = 0;
  12. setlocale(LC_ALL, "rus");
  13. cout << "N?" << endl;
  14. cin >> N;
  15. for (int i = 0; i < N; i++)
  16. {
  17. cout << "введите x";
  18. cin >> x;
  19. cout << "введите y";
  20. cin >> y;
  21. if (x*x + y*y <= 1 && -x - 1 <= y) k = k + 1;
  22. }
  23. cout<<k / N * 100 << endl;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment