GGMPL

Nalezy do cwiartki

Oct 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. bool sprawdz(int x, int y) {
  5.     if (x > 0 && y > 0) return true;
  6.     return false;
  7. }
  8.  
  9.  
  10. struct punkty {
  11.     //AB
  12.     int xA[100], yA[100];
  13. } pkt;
  14.  
  15.  
  16. int main()
  17. {
  18.     int A = 0;
  19.  
  20.     for (int i = 0; i < 100; i++) cin >> pkt.xA[i];
  21.     for (int i = 0; i < 100; i++) cin >> pkt.yA[i];
  22.     for (int i = 0; i < 100; i++) if (sprawdz(pkt.xA[i], pkt.yA[i])) {cout << pkt.xA[i] << ' ' << pkt.yA[i] << endl; A++;}
  23.     cout << "A = " << A << endl;
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment