I love you 转变为 I evol uoy
来源:互联网 发布:钣金外壳 软件 编辑:程序博客网 时间:2024/06/03 05:09
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StringDemo
{
class Program
{
static void Main(string[] args)
{
string str = null;
string str1 =Console.ReadLine();
string[] space = str1.Split(' ');
for (int i = 0; i < space.Length;i++ )
{
char[] ch=space[i].ToCharArray();
for(int j=space[i].Length-1;j>=0;j--)
{
str+=ch[j];
}
str += " ";
}
Console.WriteLine(str);
Console.ReadKey();
}
}
}
偶然间看到网友在提问,于是自己试了一下,上面是源代码用C#写的,其实也就是使用了一个string类型的切割功能。
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StringDemo
{
class Program
{
static void Main(string[] args)
{
string str = null;
string str1 =Console.ReadLine();
string[] space = str1.Split(' ');
for (int i = 0; i < space.Length;i++ )
{
char[] ch=space[i].ToCharArray();
for(int j=space[i].Length-1;j>=0;j--)
{
str+=ch[j];
}
str += " ";
}
Console.WriteLine(str);
Console.ReadKey();
}
}
}
偶然间看到网友在提问,于是自己试了一下,上面是源代码用C#写的,其实也就是使用了一个string类型的切割功能。
0 0
- I love you 转变为 I evol uoy
- 给定一字符串,将每个单词的字符顺序倒置,单词间的顺序不变。例如:输入字符串“I love you”,输出“I evol uoy”。
- 接收用户输入的一句英文,将其中的单词以反序输出。 “I love you"→“I evol uoy"
- i love you
- I LOVE YOU , DARLING!
- I LOVE YOU
- I LOVE YOU 解释
- I LOVE YOU(组图)
- I love you.
- i love you
- I love you
- I Love you
- I LOVE YOU
- I LOVE YOU
- I Love You !
- I love you
- Java I love you
- i love you, leilei
- uva11137递推和DP其实有些类似
- Android- fill_parent、wrap_content和match_parent的区别
- HDU 1023 Train Problem II(卡特兰数)
- C# 排序列表(SortedList)
- 使用泛型的单链表
- I love you 转变为 I evol uoy
- Iframe 自适应高度应用
- CocoaPods进阶:本地包管理
- Java学习笔记:Arrays
- Unity中使用UGUI与ScrollView的练习
- Speech Memorization
- Nginx运行php的配置
- HDOJ-1024 Max Sum Plus Plus (最大M子段和问题)
- 【leetcode】Remove Linked List Elements