问题描述
如果用户输入快速的棕色狐狸跳过懒惰的老狗。该程序应该读回.god dlo yzal eht revo spmuj xof nworb kciuq ehT。该程序应该能够读取任何大小的输入。我只能用它来翻转一个单词,因为它不会读短语中的每个单词。
我尝试过:
我能让我的程序反转一个单词,但就是这样。用户可以输入快速的棕色狐狸跳过懒惰的老狗。但它只返回ehT,我需要它来反转用户输入任何大小的每个单词,这样它就会返回.god dlo yzal eht revo spmuj xof nworb kciuq ehT。但我不确定如何让我的程序执行此操作。
If the user inputs "The quick brown fox jumps over the lazy old dog." the program should read back ".god dlo yzal eht revo spmuj xof nworb kciuq ehT". The program should be able to read any sized input. I am only able to get it to reverse one word because it will not read every word in the phrase.
What I have tried:
I was able to get my program to reverse one word but thats it. The user can enter "The quick brown fox jumps over the lazy old dog." but it will only return "ehT", and I need it to reverse every word that a user inputs of any size so it would return ".god dlo yzal eht revo spmuj xof nworb kciuq ehT". But I am unsure how to make my program do this.
这篇关于如何允许用户输入任何大小的短语,然后反转该短语中的所有字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!