repo.or.cz
/
qbe.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
relax one assert
[qbe.git]
/
minic
/
test
/
prime.c
blob
1dd94e7bd1eb910d99f4cda744018c8e8ccff7c3
1
#include <stdio.h>
2
3
main
() {
4
int
n
;
5
int
t
;
6
int
c
;
7
int
p
;
8
9
c
=
0
;
10
n
=
2
;
11
while
(
n
<
5000
) {
12
t
=
2
;
13
p
=
1
;
14
while
(
t
*
t
<=
n
) {
15
if
(
n
%
t
==
0
)
16
p
=
0
;
17
t
++;
18
}
19
if
(
p
) {
20
if
(
c
&&
c
%
10
==
0
)
21
printf
(
"
\n
"
);
22
printf
(
"%4d "
,
n
);
23
c
++;
24
}
25
n
++;
26
}
27
printf
(
"
\n
"
);
28
}