Advertisement
willieshi232

Untitled

Sep 25th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. public class Question1
  2. {
  3. public static final int X=10;
  4. public static void main(String [] args)
  5. {
  6. for(int row=1; row<=4; row++)
  7. {
  8. for(int nine=1; nine<=X-1; nine++)
  9. {
  10. System.out.print("9");
  11. }
  12. for(int eight=1; eight<=X-2; eight++)
  13. {
  14. System.out.print("8");
  15. }
  16. for(int seven=1; seven<=X-3; seven++)
  17. {
  18. System.out.print("7");
  19. }
  20. for(int six=1; six<=X-4; six++)
  21. {
  22. System.out.print("6");
  23. }
  24. for(int five=1; five<=X-5; five++)
  25. {
  26. System.out.print("5");
  27. }
  28. for(int four=1; four<=X-6; four++)
  29. {
  30. System.out.print("4");
  31. }
  32. for(int three=1; three<=X-7; three++)
  33. {
  34. System.out.print("3");
  35. }
  36. for(int two=1; two<=X-8; two++)
  37. {
  38. System.out.print("2");
  39. }
  40. System.out.println("1");
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement