forked from damaohongtu/JavaInterview
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_2.java
More file actions
63 lines (47 loc) · 1.35 KB
/
Main_2.java
File metadata and controls
63 lines (47 loc) · 1.35 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package BiShi.WeBank;
import java.io.File;
import java.util.Scanner;
/**
* @Author MaoTian
* @Classname Main_2
* @Description TODO
* @Date 下午4:49 2019/9/19
* @Version 1.0
* @Created by mao<[email protected]>
*/
import java.util.ArrayList;
/* 表示一个节点以及和这个节点相连的所有节点 */
class Node {
public String name = null;
public ArrayList<Node> relationNodes = new ArrayList<Node>();
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ArrayList<Node> getRelationNodes() {
return relationNodes;
}
public void setRelationNodes(ArrayList<Node> relationNodes) {
this.relationNodes = relationNodes;
}
}
public class Main_2 {
public static void main(String[] args)throws Exception {
Scanner sc =new Scanner(new File("/home/mao/workspace/面试/JavaGuide/JavaInterview/java/src/BiShi/WeBank/main_2"));
//Scanner sc =new Scanner(System.in);
while(sc.hasNext()){
int n=sc.nextInt();
if(n>=1000){
System.out.println(3);
}else{
int res=1;
for (int i = 1; i <=n ; i++) {
res=(res*i)%(1000000+3);
}
System.out.println(res);
}
}
}
}