Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <tuple>
- using namespace std;
- int main0() {
- auto p = make_pair(1, 3);
- cout << p.first << " " << p.second << endl;
- auto [a, b] = make_pair(1, 3);
- cout << a << " " << b << endl;
- int c = 0, d = 0;
- tie(c, d) = make_pair(1, 3);
- cout << c << " " << d << endl;
- pair<int, int> p2{1, 3}; // = {1, 3};
- cout << p2.first << " " << p2.second << endl;
- return 0;
- }
- int main1() {
- string s;
- cin >> s;
- cout << s << endl;
- cout << s.length() << " " << s.size() << endl;
- for (char c : s) cout << c << " ";
- cout << endl;
- return 0;
- }
- int main3() {
- char c = '1';
- cout << c << endl;
- int i = c - '0';
- cout << i << endl;
- return 0;
- }
- int main4() {
- string s = "lnip123456";
- s.erase(2, 3);
- cout << s << endl;
- s.append(" Hello");
- cout << s << endl;
- s.insert(7, "789");
- cout << s << endl;
- s.replace(7, 4, "#########");
- cout << s << endl;
- string t = s.substr(4, 5);
- cout << t << endl;
- return 0;
- }
- int main() {
- string s; cin >> s;
- string t = s;
- reverse(t.begin(), t.end());
- cout << s + t << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement