-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodex8.java
More file actions
26 lines (20 loc) · 1.32 KB
/
codex8.java
File metadata and controls
26 lines (20 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
public class codex8
{
public static void main(String[] args)
{
String num="73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018694788518438586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557668966489504452445231617318564030987111217223831136222989342338030813533627661428280644448664523874930358907296290491560440772390713810515859307960866701724271218839987979087922749219016997208880937766572733300105336788122023542180975125454059475224352584907711670556013604839586446706324415722155397536978179778461740649551492908625693219784686224828397224137565705605749026140797296865241453510047482166370484403199890008895243450658541227588666881164271714799244429282308634656748139191231628245861786645835912456652947654568284891288314260769004224219022671055626321111109370544217506941658960408071984038509624554443629812309878799272442849091888458015616609791913387549920052406368991256071760605886116467109405077541002256983155200055935729725716362695618826704282524836008232575304207529634501";
long max=0;
int i;
int j;
for(i=0;i+13<=num.length();i++)
{
long product=1;
for(j=0;j<13;j++)
{
product*=num.charAt(i+j)-'0';
max=Math.max(product,max);
}
}
System.out.println("\n"+max);
}
}