Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Prac2;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.util.Scanner;
- import java.io.*;
- public class Practica {
- public static int [] leefichero(String nombrefichero) throws FileNotFoundException {
- Scanner entrada = new Scanner(new File(nombrefichero));
- int lon = entrada.nextInt();
- int [] vector = new int[lon];
- for (int i=0; i<lon; i++){
- vector[i] = entrada.nextInt();
- }
- entrada.close();
- return vector;
- }
- public static void main(String[] args){
- int result [] = leefichero("Fichero.txt");
- }
- }
Add Comment
Please, Sign In to add comment