Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
cs-142:more-data-types-work [2016/09/06 16:25]
kseppi
cs-142:more-data-types-work [2016/09/10 15:22]
kseppi
Line 1: Line 1:
 <code cpp> <code cpp>
 #​include<​iostream>​ #​include<​iostream>​
-#​include<​iomanip>​ 
 #​include<​string>​ #​include<​string>​
    
Line 7: Line 6:
    
 int main() { int main() {
 +    
 +   /* Try this for input: 
 +      42 
 +      Kevin 
 +      Kevin D Seppi 
 +      Kevin 
 +      Kevin 
 +   */ 
 + 
  cout << "​strings:"​ << endl;  cout << "​strings:"​ << endl;
    
Line 25: Line 32:
  string middlePart = fullName.substr(nameLength / 2 - 2, 6);  string middlePart = fullName.substr(nameLength / 2 - 2, 6);
  cout << "The middle 6 characters are \""​ << middlePart << "​\""​ << endl;  cout << "The middle 6 characters are \""​ << middlePart << "​\""​ << endl;
-   cout << endl; +        ​cout << endl; 
-   ​+ 
  cout << "​CIN:"​ << endl;  cout << "​CIN:"​ << endl;
    
Line 56: Line 63:
  cout << endl;  cout << endl;
    
- cout << "Full name: " << fullName << "That is better." << endl;+ cout << "Full name: " << fullName << " ​What?" << endl;
    
  // back to numbers  // back to numbers
cs-142/more-data-types-work.txt · Last modified: 2016/09/10 15:35 by kseppi
Back to top
CC Attribution-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0