Home>
I want to display the calculation result in Ruby vertically.
puts 50 * 50
Result: 2500
I want to make it vertical instead of horizontal.
Result:
2
5
0
0
I want to
Thank you.
-
Answer # 1
-
Answer # 2
(50 * 50) .to_s .each_char {| c | puts c}
-
Answer # 3
puts (50 * 50) .to_s.chars
Related articles
- firebase - i want to be able to display the calculation result of age in nuxtjs
- ruby - i want to display specific columns in rails in descending order of numbers
- ruby - i want to display only the image of the logged-in user when executing the search function
- javascript - i want to output the profit calculation result using mathfloor
- ruby - i want to display lowercase hexadecimal letters in uppercase
- ruby on rails - i want to display the posted images in a random order (get information from the record)
- ruby - i want to display the alphabet in capital letters when displaying in hexadecimal
- ruby - if there is a job waiting in sidekiq, i want to display that it is being processed in rails view
- ruby - i want to display the name of the poster
- ruby - when the search result of the model is displayed by the function to see more in kaminari, the whole is displayed instead
- python - saving the calculation result of the correlation coefficient
- ruby - i want to display sold out
- ruby - sprockets :: rails :: helper :: assetnotfound in posts # index i want to display the images saved in my computer
- ruby - i want to display monthly data in one
- ruby - i'd like to implement a genre-specific display function in [rails], but i'm having trouble as i expected
- ruby on rails 6 - i want to change the display of the product detail page according to the user's conditions
- ruby on rails - [rails] how to round (omission and display) the character string of link_to
- bootstrap display in ruby on rails is broken
- ruby on rails - i want to display the schedule with rails full calendar
- ruby on rails - i want to display all the images in the [rails] directory in the browser!
Trends