You are viewing a single comment's thread. Return to all comments →
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner sc=new Scanner(System.in); long n=sc.nextInt(); long sum=0; for(long ni=1;ni<=n;ni++) { for(long a=1;a<=ni;a++) { for(long b=0;b
} } } } System.out.println(sum);
} }
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #152: Writing 1/2 as a sum of inverse squares
You are viewing a single comment's thread. Return to all comments →
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner sc=new Scanner(System.in); long n=sc.nextInt(); long sum=0; for(long ni=1;ni<=n;ni++) { for(long a=1;a<=ni;a++) { for(long b=0;b
} }