01: /****************************************************************************
02: ** COPYRIGHT (C):    1998 Cay S. Horstmann. All Rights Reserved.
03: ** PROJECT:          Computing Concepts with C++ 2E
04: ** FILE:             initials.cpp
05: ** NOTE TO STUDENTS: This file has been edited to be compatible with older
06: ** compilers. If your compiler fully supports the ANSI/ISO C++
07: ** standard, remove the line #include "ccc_ansi.cpp". You can also remove
08: ** the lines #ifndef CCC_ANSI_H and #endif
09: ****************************************************************************/
10: 
11:    #include "ccc_ansi.cpp"
12:    #ifndef CCC_ANSI_H
13: 
14: #include <iostream>
15: #include <string>
16: 
17: using namespace std;
18: 
19:    #endif
20: 
21: int main()
22: {  cout << "Please enter your full name (first middle last): ";
23:         string first;
24:         string middle;
25:         string last;
26:         cin >> first >> middle >> last;
27:         string initials = first.substr(0, 1) + middle.substr(0, 1)
28:                 + last.substr(0, 1);
29:         cout << "Your initials are " << initials << "\n";
30: 
31:    return 0;
32: }