项目作者: Puneethgr

项目描述 :
A unique problem which deals with advanced string manupulation (adding capital letter after certain symbols, removing multiple spaces, adjusting width)
高级语言: C
项目地址: git://github.com/Puneethgr/Advanced-String-Manipulation-Problem.git


Advanced-String-Manipulation-Problem

A unique problem which deals with advanced string manipulation (adding capital letter after certain symbols, removing multiple spaces, adjusting width)


Problem Statement:

Input:

  1. A string input from the user (within one single line)

  2. Left width, Right width and Total width

Rules:

1.In the given string, multiple spaces should be converted into a single space.

  1. If the input string contains full stop, comma, exclamation,
    then, the letter following these symbols will be capital AND prefixed with a single space.

Output:

Output the final result based on the above rules


Example:

INPUT:

I love programming! i started programming,when i was 10 years old.i enjoyed it.

left width = 3
right width = 5
total width = 10


OUTPUT:

Removing multiple spaces:

I love programming! i started programming,when i was 10 years old.i enjoyed it.

Text after capitalizing and prefixed with a single space:

I love programming! I started programming, When i was 10 years old. I enjoyed it.

Final result=

$$$I *

$$$l o *

$$$v e *

$$$ p *

$$$r o *

$$$g r *

$$$a m *

$$$m i *

$$$n g *

$$$! *

$$$I *

$$$s t *

$$$a r *

$$$t e *

$$$d *

$$$p r *

$$$o g *

$$$r a *

$$$m m *

$$$i n *

$$$g , *

$$$ W *

$$$h e *

$$$n *

$$$i *

$$$w a *

$$$s *

$$$1 0 *

$$$ y *

$$$e a *

$$$r s *

$$$ o *

$$$l d *

$$$. *

$$$I *

$$$e n *

$$$j o *

$$$y e *

$$$d *

$$$i t *

$$$. *