Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Input.txt Ir senis, ir vaikas nezinojo, kur eiti jei ir pinigu turetu...
- counter = 0
- data = ''
- s = 0
- b="ir "
- c="Ir "
- file = File.new("input.txt", "r")
- while (line = file.gets)
- counter = counter + 1
- #puts "#{line}"
- data += line
- end
- file.close
- puts data
- for i in 0..data.length-1 do
- if (data[i, b.length] == b) || (data[i, c.length] == c)
- s = s + 1
- end
- end
- puts "Simboliu eiluteje yra #{s} zodziu - #{b}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement