fork download
  1. #include<iostream>
  2. using namespace std;
  3. struct toado
  4. {
  5. int A[1000];
  6. double x;
  7. double y;
  8. int n;
  9. };
  10. void nhapmang(toado a[], int n, float x, float y);
  11. void nhapmang(toado a[], int n,float x, float y)
  12. {
  13. do
  14. {
  15. cout << "cho biet so toa do " << endl;
  16. cin >> n;
  17. } while (n <= 0);
  18. for (int i = 1; i <= n; i++)
  19. {
  20. cout << "nhap toa do mang[" << i << "] = "; cin >> x >> y;
  21. cout << "mang[" << i << "] = " << "(" << x << "," << y << ")" << endl;
  22. }
  23. }
  24. int main()
  25. {
  26.  
  27. toado A[1000];
  28. int n;
  29. float x, y;
  30. cin >> n >> x >> y;
  31. nhapmang(A, n, x, y);
  32. system("pause");
  33. return 0;
  34. }
Success #stdin #stdout #stderr 0s 19048KB
stdin
3 0 0
3
0 1
1 0
1 1
stdout
cho biet so toa do 
nhap toa do mang[1] = mang[1] = (0,1)
nhap toa do mang[2] = mang[2] = (1,0)
nhap toa do mang[3] = mang[3] = (1,1)
stderr
sh: 1: pause: not found