All Tracks Algorithms String Algorithms Basics of String Manipulation Problem

Compiler Version
Tag(s):

Ad-Hoc, Data Structures, Implementation

Problem
Editorial
Analytics

You are converting an old code for a new version of the compiler.

In the old code we have used "->" for pointers. But now we have to replace each "->" with a ".". But this replacement shouldn't be done inside commments. A comment is a string that starts with "//" and terminates at the end of the line.

Input:

At max. \(2000\) lines of code.

Each line of code consists of at maximum \(60\) characters.

Output:

New code with required changes.

SAMPLE INPUT
int t; //variable t
t->a=0;  //t->a does something
return 0;
SAMPLE OUTPUT
int t; //variable t
t.a=0;  //t->a does something
return 0;
Explanation

"->" is not converted to "." inside comments.

Time Limit: 5.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, C++17, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, Java 14, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, Python 3.8, R(RScript), Racket, Ruby, Rust, Scala, Swift-4.1, Swift, TypeScript, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

This Problem was Asked in

One97

Challenge Name

Paytm Code Jam

OTHER PROBLEMS OF THIS CHALLENGE
Notifications
View All Notifications

?