Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- //VECTOR
- vector<int> tosta;
- for(int i = 1; i <= 5; i++){
- int n;
- scanf("%d", &n);
- tosta.push_back(n);
- }
- sort(tosta.begin(),tosta.end());
- //Seja tosta = {30,42,50,70,80}
- int resp1 = *upper_bound(tosta.begin(),tosta.end(),42) //resp1 = 50
- int resp2 = *lower_bound(tosta.begin(),tosta.end(),42) //resp2 = 42
- for(int i = 0; i < 5; i++){
- printf("%d ", tosta[i]);
- }
- //PAIR
- vector<pair<int,int>> lista;
- pair<int,int> teo;
- teo.first = 6;
- teo.second = 7;
- tosta.push_back(teo)
- printf("%d %d", teo.first, teo.second);
- //STRING
- string vj;
- cin >> vj
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment