repo.or.cz
/
mono.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2010-02-19 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git]
/
mono
/
tests
/
test-prime.cs
blob
28ffb3de4ada7f167af71fb70d702f2053b51c24
1
using
System
;
2
3
class
Test
{
4
public static bool
testprime
(
int
x
) {
5
if
((
x
&
1
) !=
0
) {
6
for
(
int
n
=
3
;
n
<
x
;
n
+=
2
) {
7
if
((
x
%
n
) ==
0
)
8
return false
;
9
}
10
return true
;
11
}
12
return
(
x
==
2
);
13
}
14
15
public static int
Main
() {
16
if
(!
testprime
(
17
))
17
return
1
;
18
return
0
;
19
}
20
}