daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Jan 11th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Задание 1
  2. for a = 1, 10 do
  3.     if math.fmod(a, 3) == 0 then
  4.         print(1)
  5.     end
  6.     if math.fmod(a, 5) == 0 then
  7.         print(2)
  8.     end
  9.     if math.fmod(a, 3) == 0 or math.fmod(a, 5) == 0 then
  10.         print(3)
  11.     end
  12. end
  13.  
  14. -- Задание 2
  15. function sprintf(form, p1, dmg, p2)
  16.     form = form:gsub('{0}', p1)
  17.     form = form:gsub('{1}', dmg)
  18.     form = form:gsub('{2}', p2)
  19.     print(form)
  20. end
  21.  
  22. -- Задание 3
  23. local myTable = {
  24.     ['p1'] = 'p1 out',
  25.     ['p2'] = 'p2 out',
  26.     ['p3'] = 'p3 out',
  27.     ['p4'] = 'p4 out',
  28.     ['p5'] = 'p5 out'
  29. }
  30. function getTable(arg)
  31.     print(myTable[arg])
  32. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top