Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string Name;
- cout << "Enter the name: ";
- getline(cin, Name);
- cout << "You entered name " << Name << endl;
- cout << "This name is " << Name.length() << " characters long." << endl;
- Name.append(" Petrov");
- cout << "Appended " << Name << endl;
- cout << "New name is " << Name.length() << " characters long." << endl;
- for (int i = 0; i < Name.length(); i++)
- cout << Name[i] << endl;
- string s1, s2;
- s1 = "Pexar";
- s2 = "Petyr";
- if (s1 < s2)
- cout << s1 << " is less than " << s2 << endl;
- else
- cout << s1 << " is greater or equal than " << s2 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement