Advertisement
Ivakis

Group Name

Sep 7th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. import java.text.DecimalFormat;
  2. import java.util.Scanner;
  3.  
  4. public class demo {
  5. public static void main(String[] args) {
  6. Scanner scan = new Scanner(System.in);
  7.  
  8.  
  9. char ch1 = scan.nextLine().charAt(0);
  10. char ch2 = scan.nextLine().charAt(0);
  11. char ch3 = scan.nextLine().charAt(0);
  12. char ch4 = scan.nextLine().charAt(0);
  13. int n = Integer.parseInt(scan.nextLine());
  14.  
  15. int count = -1;
  16.  
  17. for (char i = 'A'; i <= ch1; i++) {
  18. for (char j = 'a'; j <= ch2; j++) {
  19. for (char k = 'a'; k <= ch3; k++) {
  20. for (char l = 'a'; l <= ch4; l++) {
  21. for (int m = 0; m <= n; m++) {
  22. count++;
  23. }
  24. }
  25. }
  26. }
  27. }
  28.  
  29. System.out.println(count);
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement