Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
remove dublicates from string using recursion
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//g++ 7.4.0 #include <iostream> using namespace std; void dublicate( char s[] ){ if(s[0]=='\0') { return; } if(s[0]==s[1]){ int i=1; for(;s[i]!='\0';i++){ s[i-1]=s[i]; } s[i-1]=s[i]; dublicate(s); } else{ dublicate(s+1); } } int main() { char str[100]; cin>>str; dublicate(str); cout<<str; }
g++
aabcccrrdffdd
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 0.53 sec, absolute running time: 0.17 sec, cpu time: 0.02 sec, memory peak: 5 Mb, absolute service time: 0,78 sec
edit mode
|
history
|
discussion
abcrdfd