repo.or.cz
/
sixpic.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
New version of the assembler, that does better branch generation.
[sixpic.git]
/
tests
/
general
/
sigma.c
blob
2c99e1b5e6bedc136e5160cad9d89d7edd1fed94
1
int
sigma
(
int
n
){
2
int
res
=
0
;
3
while
(
n
<
n
+
1
){
4
switch
(
n
){
5
case
0
:
6
return
res
;
7
case
1
:
8
res
++;
9
/* break; */
10
n
--;
11
continue
;
12
default
:
13
res
=
res
+
n
;
14
}
15
n
--;
16
}
17
return
res
;
18
}
19
20
sigma
(
5
);