squawk1738
13.07.2021 •
Computers and Technology
Translate the following pseudocode for randomly permuting the characters in a string into a C program.
Read a word.
Repeat word.length() times
Pick a random position i in the word.
Pick a random position j > i in the word.
Swap the letters at positions j and i.
Print the word.
To swap the letters, construct substrings as follows:
first i middle j last
Then replace the string with
first + word.substr(j,1) + middle+ word.substr(i,1) + last
Please make copy paste available
Please write in C++
Solved
Show answers
More tips
- D Dating, Love, Relationships Does a Person s Character Depend on the Color of Their Eyes?...
- O Other Childhood Fears: What Many of Us Experienced...
- H Health and Medicine Simple and Effective: How to Get Rid of Cracked Heels...
- L Leisure and Entertainment What to Bring on a Hike? Essential Items to Pack for a Safe and Enjoyable Adventure...
- L Leisure and Entertainment Couchsurfing: A New Way to Travel...
- S Style and Beauty Autotanning: Harmful or Safe?...
- F Food and Cooking 10 Ideas for a Wedding Anniversary Gift...
- H Health and Medicine How to Reduce Sweating in the Heat and Beyond: Say Goodbye to Excessive Sweat...
- F Food and Cooking Do Aphrodisiacs Really Work? Separating Fact from Fiction...
- H Health and Medicine What to Eat to Lose Weight?...
Ответ:
??? What are you doing in this website? is this like a somehow an actual question or something innapropriate