بکندباز

یک جمله داده شده است، تابعی بنویسید که حرف اول هر کلمه را به کلمه بعدی در جمله منتقل کند (انتقال به راست).

نمونه ورودی و خروجی

ShiftSentence("create a function") ➞ "freate c aunction"

ShiftSentence("it should shift the sentence") ➞ "st ihould shift she tentence"

ShiftSentence("backendbaz") ➞ "backendbaz"

نکات:

  • حرف اول آخرین کلمه به اولین کلمه در جمله منتقل می‌شود.
  • تمام جملات با حروف کوچک نوشته شده‌اند.
  • توجه کنید که کلمات تکی بدون تغییر باقی می‌مانند (مثال شماره 3).
ShiftSentence("create a function")  ➞ "freate c aunction"
ShiftSentence("it should shift the sentence")  ➞ "st ihould shift she tentence"
ShiftSentence("backendbaz")  ➞ "backendbaz"
ShiftSentence("the output is not very legible")  ➞ "lhe tutput os iot nery vegible"
ShiftSentence("tey ghis uot hnscrambled")  ➞ "hey this got unscrambled"
ShiftSentence("i love to eat scrambled eggs and ham")  ➞ "h iove lo tat ecrambled sggs end aam"
ShiftSentence("mitochondria is the powerhouse of the cell")  ➞ "citochondria ms ihe towerhouse pf ohe tell"

هنوز پاسخی برای این تمرین ثبت نشده است

نظرات

*
*