Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package cisla;
- public class Cisla {
- public static void vypis () {
- int r = (int) Math.round(99999 * Math.random())+1;
- System.out.println("cislo: " + r);
- String[] vypis = new String[5];
- int d = 10000, c;
- for (int i = vypis.length - 1; i >= 0; --i) {
- c = r / d;
- r -= c * d;
- vypis[i] = d + "\t=" + c;
- d /= 10;
- }
- for (int i = 0; i < vypis.length; ++i ) {
- System.out.println(vypis[i]);
- }
- }
- public static void main(String[] args) {
- Cisla.vypis();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment