-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHash.java
More file actions
35 lines (30 loc) · 786 Bytes
/
Hash.java
File metadata and controls
35 lines (30 loc) · 786 Bytes
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
27
28
29
30
31
32
33
34
35
//package OOPEuler;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.Hashtable;
import java.math.BigInteger;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.io.File;
import java.io.FileNotFoundException;
public class Hash{
public static Hashtable MTable(){
Scanner lector;
String tmpfact,tmppow;
StringTokenizer st;
Hashtable tabla=new Hashtable(1000000);
try{
lector=new Scanner(new File("final.txt"));
while(lector.hasNext()){
st=new StringTokenizer(lector.next(),"-");
tmpfact=st.nextToken();
tmppow=st.nextToken();
tabla.put(tmppow,tmpfact);
}
System.out.println( tabla.get("0"));
lector.close();
}catch(FileNotFoundException fnfe){
}
return tabla;
}
}