Advertisement
roronoa

maj premières lettres et min autres

Jul 15th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. import java.util.*;
  2. import java.io.*;
  3. import java.math.*;
  4.  
  5. /**
  6.  * Auto-generated code below aims at helping you parse
  7.  * the standard input according to the problem statement.
  8.  **/
  9. class Solution {
  10.  
  11.     public static void main(String args[]) {
  12.         Scanner in = new Scanner(System.in);
  13.         String[] S = in.nextLine().split(" ");
  14.         String r = "";
  15.         for(String s : S)
  16.         {
  17.             s+= " ";
  18.             String n = "";
  19.             n += s.toUpperCase().charAt(0);
  20.             for(int i = 1; i < s.length(); i++)
  21.                 n += s.toLowerCase().charAt(i);
  22.             r += n.trim() + " ";
  23.         }
  24.         System.out.println(r.trim());
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement