当前位置:网站首页>2022.4.21-----leetcode.824
2022.4.21-----leetcode.824
2022-04-22 05:29:00 【路Lu727】
public String toGoatLatin(String sentence) {
String[] ss=sentence.split(" ");//分割
for(int i=0;i<ss.length;i++){
char ch=ss[i].charAt(0);
//判断首字母
if("aeiouAEIOU".indexOf(ch)!=-1)
ss[i]+="ma";
else{
ss[i]=ss[i].substring(1)+ch+"ma";
}
//添加'a'
for(int j=0;j<i+1;j++){
ss[i]+="a";
}
}
String ans="";
for(int i=0;i<ss.length;i++){
ans+=ss[i];
if(i<ss.length-1)
ans+=" ";
}
return ans;
}
版权声明
本文为[路Lu727]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_60466670/article/details/124333858
边栏推荐
猜你喜欢

Tree array

abcabc

Configure security policy on ENSP

The signal isolator is used in the water treatment control system to solve the problem of limitation due to some on-site non electric installation conditions

libcurl等第三方库通用编译方法
My creation anniversary

Pyqt5+Yolov5+Mss实现一个实时桌面检测软件

How to use U deep boot U disk to clear the system login password

Idea 2021.1 Useful settings

Cached and condensed: Web cache degradation in the wild
随机推荐
Linked list (C language)
Fundamentals of Unreal Engine Programming (II)
Basic configuration of NP and OSPF
Auto.js 画布设置防锯齿paint.setAntiAlias(true);
時間複雜度和空間複雜度
Auto. JS canvas setting anti aliasing paint setAntiAlias(true);
Method for coexistence of Keil-C51 and keil arm
AWD platform construction – cardinal
Keil-C51 与 Keil -ARM 共存的方法
[C #] implementation scheme of singleton mode
Unreal engine sequence effect and audio binding trigger
Empty object mode (3.14-3.20)
SQL learning record
Defining "disinformation"
[WPF] data template selector
Four startup modes of activity
Analysis of database log level: (2022.2.21-2022.2.27)
GBase 8s V8.8 SQL 指南:教程-6.1.2(1)
Kaggle_NBME NLP比赛Baseline详解(2)
Codeforces Round #781 (Div. 2) ABCD