in Java "puro", cosi' funziona:
codice:public class c { public static void main(String [ ] args) { int[] ruota = new int[10]; int valoreRandom; int sommaRuota = 0; for (int i=0; i<10; i++) { //creo il valore random compreso tra 0 e 100 valoreRandom = (int)(Math.random()*100); //inserisco il valore nel vettore ruota[i] = valoreRandom; sommaRuota = sommaRuota + valoreRandom; } for (int i=0; i<10; i++) { System.out.println ("c " + ruota[i]); } } }

Rispondi quotando