Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define mp make_pair
- #define pb push_back
- #define f first
- #define s second
- using namespace std;
- typedef vector<int> vi;
- typedef pair<int, int> ii;
- typedef vector<ii> vii;
- typedef vector<vi> vvi;
- int main(){
- int n;
- cin >> n;
- vector<int> va;
- vector<int> vb(n);
- for(int i = 0; i < n; i++){
- int aux;
- cin >> aux;
- vb[i] = aux;
- va.push_back(aux);
- }
- for(int i = 0; i < n; i++){
- cout << va[i] << " - - - " << vb[i] << endl;
- }
- cout << "-------" << endl;
- cin >> n;
- vector<pair<int,int>> vp;
- for(int i = 0; i < n; i++){
- int x, y;
- cin >> x >> y;
- vp.push_back(make_pair(x, y));
- }
- for(int i = 0; i < n; i++){
- cout << "x = " << vp[i].first << " y = " << vp[i].second << endl;
- }
- cout << "-------" << endl;
- cin >> n;
- vector<vector<int>> vm;
- int matrix[n][n];
- for(int i = 0; i < n; i++){
- vm.push_back(vector<int>()); //inserção de um vetor vazio
- for(int j = 0; j < n; j++){
- int aux;
- cin >> aux;
- matrix[i][j] = aux;
- vm[i].push_back(aux);
- }
- }
- for(int i = 0; i < n; i++){
- cout << "inicio linha" << endl;
- for(int j = 0; j < n; j++){
- cout << "matrix -> " << matrix[i][j] << " vector -> " << vm[i][j] << endl;
- }
- cout << "fim linha" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement