Advertisement
Guest User

EASY ESTO E FASIL

a guest
Jan 22nd, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. package aceptaelreto;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Aceptaelreto {
  6. public static void main(String[] args) {
  7. Scanner scan = new Scanner(System.in);
  8. int cuantos=scan.nextInt();
  9. int alimentos [] = new int [cuantos*2];
  10. int peso [] = new int [cuantos];
  11. for (int i = 0; i < alimentos.length; i++) {
  12. alimentos[i] = scan.nextInt();
  13. }
  14.  
  15. for (int i = 0; i < peso.length; i++) {
  16. for (int j = 0; j < peso.length; j++) {
  17. peso[j]=alimentos[i++]-alimentos[i];
  18. i++;
  19. }
  20. }
  21.  
  22. for (int j = 0; j < cuantos; j++) {
  23. System.out.println(peso[j]*-1);
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement