import java.util.*;
import java.lang.*;
import java.io.*;

class Main {
    public static String compute(int bytesQuantity) {
        System.err.println(bytesQuantity);
        if(bytesQuantity<1024)
            return bytesQuantity+"";
        else if(bytesQuantity >=1024 && bytesQuantity< 1048576)
            return bytesQuantity/1024 + " KiB";
        else
            return bytesQuantity/1048576 + " MiB";
    }
    
    public static void main(String[] args) {
        System.out.println(compute(1025));
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: