summaryrefslogtreecommitdiff
path: root/4p23.cpp
blob: b53cc849f3a01ffccdd344cf48eaf05bfb25b549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>

/*
 *
 * 4.23
 *
 *
 */

int main () {

	/*
	  
	  Took me a while to figure out
	  was not so sure what the author
	  wanted to achieve. I mean there
	  are several ways we can paranthesize
	  this so it was a little hard to do...
	  
	 */
	
	std::string s = "word";
	std::string pl = s + (s[s.size() - 1] == 's' ? "" : "s") ;
	std::cout << pl << std::endl;
	return 0;
}