Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package tostring;
- import java.util.Scanner;
- /**
- *
- * @author PC
- */
- public class ToString {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- // System.out.print("Nhap ten cua ban: ");
- // Scanner br = new Scanner(System.in);
- // String name = br.nextLine();
- // String s1 = name.substring(0, 1).toUpperCase();
- // String nameCapitalized = s1 + name.substring(1);
- // System.out.println(nameCapitalized);
- System.out.print("Nhap ten cua ban: ");
- Scanner a = new Scanner(System.in);
- String name = a.nextLine();
- System.out.print("Nhap so thu tu chu cai can in hoa: ");
- int stt = a.nextInt();
- String s = name.charAt(stt).toUpperCase();
- System.out.println(s+ name);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement