coderrohan14

StringQ4.java

Jul 3rd, 2021
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Solution {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. String[] arr = sc.nextLine().split(" ");
  7. int k = sc.nextInt();
  8. for(int i=0;i<k;i++){
  9. System.out.print(arr[i]+" ");
  10. }
  11. }
  12. }
  13.  
Advertisement
Add Comment
Please, Sign In to add comment