Advertisement
vladimirVenkov

AddingPolynomials.java

Jun 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. package Modules.Module_1;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class AddingPolynomials {
  6.     public static void main(String[] args) {
  7.         Scanner in = new Scanner(System.in);
  8.         int n = in.nextInt();
  9.         in.nextLine();
  10.         int[] poly = new int[n];
  11.         for (int i = 0; i < n; i++) {
  12.             poly[i] = in.nextInt();
  13.         }
  14.         in.nextLine();
  15.         for (int i = 0; i < n; i++) {
  16.             System.out.print((poly[i] + in.nextInt()) + " ");
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement