Screen Ratio Calculation

Run Settings
LanguageJava
Language Version
Run Command
class Main { public static void main(String[] args) { ratio(1920, 1080); } static void ratio(int height, int width) { final int gcd = gcd(height, width); if(height > width) { showAnswer(height/gcd, width/gcd); } else { showAnswer(width/gcd, height/gcd); } } static int gcd(int p, int q) { if (q == 0) return p; else return gcd(q, p % q); } static void showAnswer(int a, int b) { System.out.println(a + ":" + b); } }
Editor Settings
Theme
Key bindings
Full width
Lines