Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Forge {
  4.  
  5. public static void main(String[] args){
  6. Scanner tastiera = new Scanner(System.in);
  7.  
  8. int nbeni = 0;
  9. String beni = null;
  10. int sbeni = 0;
  11. int i = 0;
  12.  
  13. System.out.println("Numero di beni da inserire:");
  14.  
  15. nbeni = tastiera.nextInt();
  16.  
  17. System.out.println("Inserire " +nbeni+ " beni e numero desiderato");
  18. for(i=0; i<nbeni; i++){
  19. beni = tastiera.next();
  20. sbeni = tastiera.nextInt();
  21. }
  22.  
  23. System.out.println("Ti serve:");
  24. for(i = 0; i<nbeni; i++){
  25. System.out.println(sbeni+ " di " +beni);
  26. }
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement