a
This commit is contained in:
1 parent
b2d11a342b
commit
4f77adac6a
110 files changed
+64
-14
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import java.util.Scanner;
|
||||
|
||||
public class StringInitialization {
|
||||
public static void main(String[] var0) {
|
||||
Scanner sc = new Scanner(System.in);
|
||||
String s = sc.nextLine();
|
||||
StringBuffer sb = new StringBuffer(s);
|
||||
sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
|
||||
for (int i = 1; i < s.length(); ++i)
|
||||
if (s.charAt(i - 1) != ',' && s.charAt(i - 1) != ' ')
|
||||
sb.setCharAt(i, Character.toLowerCase(sb.charAt(i)));
|
||||
else
|
||||
sb.setCharAt(i, Character.toUpperCase(sb.charAt(i)));
|
||||
System.out.println(sb);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user