Advertisement
Varasku

Zadanie 1 z stringa o imie

Nov 22nd, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1.  
  2. package aaaaaaaaaaa;
  3.  
  4. import java.util.Scanner;
  5.  
  6.  
  7. public class Aaaaaaaaaaa {
  8.  
  9.  
  10. public static void main(String[] args) {
  11.  
  12.  
  13. Scanner sc=new Scanner(System.in);
  14. String imie;
  15. System.out.println("Podaj imię");
  16. imie = sc.nextLine();
  17.  
  18. if(imie.charAt(imie.length()-1)=='a'){
  19. System.out.println("Witamy Pani= "+imie);
  20. }
  21. else{
  22. System.out.println("Witamy Pana= "+imie);
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement