Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
34
Task/General-FizzBuzz/Nanoquery/general-fizzbuzz.nanoquery
Normal file
34
Task/General-FizzBuzz/Nanoquery/general-fizzbuzz.nanoquery
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
factors = {}
|
||||
words = {}
|
||||
|
||||
// get the max number
|
||||
print ">"
|
||||
max = int(input())
|
||||
|
||||
// get the factors
|
||||
inp = " "
|
||||
while inp != ""
|
||||
print ">"
|
||||
inp = input()
|
||||
if " " in inp
|
||||
factors.append(int(split(inp, " ")[0]))
|
||||
words.append(split(inp, " ")[1])
|
||||
end
|
||||
end
|
||||
|
||||
// output all the numbers
|
||||
for i in range(1, max)
|
||||
foundfactor = false
|
||||
for j in range(0, len(factors) - 1)
|
||||
if (i % factors[j]) = 0
|
||||
foundfactor = true
|
||||
print words[j]
|
||||
end
|
||||
end
|
||||
j = 0
|
||||
|
||||
if !foundfactor
|
||||
print i
|
||||
end
|
||||
println
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue