how to make each alphabet on string has space before the other alphabet | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

how to make each alphabet on string has space before the other alphabet

for example input=code output= c o d e but the input code have to use= scanf(%s, input) so i can only use one %s

13th Oct 2018, 7:01 AM
Yoaraci
Yoaraci - avatar
1 Answer
+ 1
#include <iostream> using namespace std; int main() { string s; cin>>s; for(int i=0; i<s.size(); i++) cout<<s[i]<<" "; cout<<endl; return 0; }
13th Oct 2018, 7:16 AM
Raziul Islam
Raziul Islam - avatar