Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #OS LAB1/1 made by Fensa08
- import java.io.*;
- public class HW01_1 {
- public static void main(String[] args) throws IOException {
- BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
- System.out.println("Vnesi lokacija");
- String path = in.readLine();
- File f = new File(path);
- File []lista = f.listFiles(new FilenameFilter() {
- @Override
- public boolean accept(File dir, String name) {
- return name.endsWith(".txt");
- }
- });
- float prosek = 0;
- for(File file: lista){
- prosek += file.length();
- }
- prosek = prosek / lista.length;
- System.out.println("Prosecna golemina na fajlovi so .txt ekstenzija e: " + prosek + " bytes");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement