ya_zay4eg

level04.lesson10.task05

Nov 20th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. package com.javarush.test.level04.lesson10.task05;
  2.  
  3. /* Таблица умножения
  4. Вывести на экран таблицу умножения 10х10 используя цикл while.
  5. Числа разделить пробелом.
  6. 1 2 3 4 5 6 7 8 9 10
  7. 2 4 6 8 10 12 14 16 18 20
  8. ...
  9. */
  10.  
  11. public class Solution
  12. {
  13.     public static void main(String[] args) throws Exception
  14.     {
  15.         int row=1;
  16.         int line=10;
  17.         int number=1;
  18.  
  19.         while (row<11){
  20.             while (line>0)
  21.             {
  22.                 System.out.print(number + " ");
  23.                 line--;
  24.                 number=number+row;
  25.             }
  26.             System.out.println("");
  27.             line=10;
  28.             row++;
  29.             number=row;
  30.         }
  31.         }
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment