Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
30
Task/Population-count/EasyLang/population-count.easy
Normal file
30
Task/Population-count/EasyLang/population-count.easy
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
func popcnt x .
|
||||
while x > 0
|
||||
r += x mod 2
|
||||
x = x div 2
|
||||
.
|
||||
return r
|
||||
.
|
||||
proc show3 . .
|
||||
write "3^n:"
|
||||
bb = 1
|
||||
for i = 1 to 30
|
||||
write " " & popcnt bb
|
||||
bb *= 3
|
||||
.
|
||||
print ""
|
||||
.
|
||||
proc show s$ x . .
|
||||
write s$
|
||||
while n < 30
|
||||
if popcnt i mod 2 = x
|
||||
n += 1
|
||||
write " " & i
|
||||
.
|
||||
i += 1
|
||||
.
|
||||
print ""
|
||||
.
|
||||
show3
|
||||
show "evil:" 0
|
||||
show "odious:" 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue