fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. char family[20];
  6. char name[20];
  7. cout << "Enter student's first name and last name:\n";
  8. cin.ignore(100, '\n');
  9. cin.getline(name, 20, ' ');
  10. cin.getline(family, 20, ' ');
  11. cout << "Name: " << name << endl;
  12. cout << "Family: " << family << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 3464KB
stdin
Joe Smith
stdout
Enter student's first name and last name:
Name: Joe
Family: Smith