Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string firstName, lastName;
- cin >> firstName >> lastName;
- int age;
- cin >> age;
- cin.ignore();
- string town;
- getline(cin, town);
- cout << "You are " << firstName << ' ' << lastName << ", a " << age << "-years old person from " << town << '.' << endl;
- return 0;
- }
- ИЛИ:
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string firstName, lastName;
- cin >> firstName >> lastName;
- int age;
- cin >> age;
- cin.ignore();
- string town;
- getline(cin, town);
- printf("You are %s %s, a %i-years old person from %s.", firstName.c_str(), lastName.c_str(), age, town.c_str());
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement