SHARE
TWEET

Untitled

a guest May 23rd, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. #define mp make_pair
  3. #define pb push_back
  4. #define f first
  5. #define s second
  6.  
  7. using namespace std;
  8.  
  9. typedef vector<int> vi;
  10. typedef pair<int, int> ii;
  11. typedef vector<ii> vii;
  12. typedef vector<vi> vvi;
  13.  
  14. int main(){
  15.  
  16.     int n;
  17.     cin >> n;
  18.     vector<int> va;
  19.     vector<int> vb(n);
  20.     for(int i = 0; i < n; i++){
  21.         int aux;
  22.         cin >> aux;
  23.         vb[i] = aux;
  24.         va.push_back(aux);
  25.     }
  26.     for(int i = 0; i < n; i++){
  27.         cout << va[i] << " - - - " << vb[i] << endl;
  28.     }
  29.     cout << "-------" << endl;
  30.     cin >> n;
  31.     vector<pair<int,int>> vp;
  32.     for(int i = 0; i < n; i++){
  33.         int x, y;
  34.         cin >> x >> y;
  35.         vp.push_back(make_pair(x, y));
  36.     }
  37.     for(int i = 0; i < n; i++){
  38.         cout << "x = " << vp[i].first << "  y = " << vp[i].second << endl;
  39.     }
  40.     cout << "-------" << endl;
  41.     cin >> n;
  42.     vector<vector<int>> vm;
  43.     int matrix[n][n];
  44.     for(int i = 0; i < n; i++){
  45.         vm.push_back(vector<int>()); //inserção de um vetor vazio
  46.         for(int j = 0; j < n; j++){
  47.             int aux;
  48.             cin >> aux;
  49.             matrix[i][j] = aux;
  50.             vm[i].push_back(aux);
  51.         }
  52.     }
  53.     for(int i = 0; i < n; i++){
  54.         cout << "inicio linha" << endl;
  55.         for(int j = 0; j < n; j++){
  56.             cout << "matrix -> " << matrix[i][j] << " vector -> " << vm[i][j] << endl;
  57.         }
  58.         cout << "fim linha" << endl;
  59.     }
  60. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top