Newer
Older
Ruby / index.html
@SUGIURA Takahiro SUGIURA Takahiro on 3 Aug 869 bytes 2025-08-03 15:15:11
<!DOCTYPE html>
<html>
<!-- Default style for pretty-print of text files -->
<head><title>each_loop.rb</title>
<style type="text/css">
pre {margin-left: 6ex;}
pre span {counter-increment: linenum; text-align: right; position: relative;}
pre span:before {
    position: absolute; right: 0px;
    background: #ddd; text-align: right; padding: 0 0.2ex;
    width: 5.5ex; margin-right: 0.5ex;
    content: counter(linenum) ":";
}
</style>
</head>
<body>
<p>[[ <a href="?showattc+article_m+53+raw">RAW TEXT</a>(DOWNLOAD here) ]]</p>
<pre lang="en">
<span></span>#!/usr/vin/env ruby
<span></span># -*- coding: utf-8 -*-
<span></span>
<span></span>nedan = [50,100,150,200]
<span></span>i = 0
<span></span>
<span></span>nedan.each do |n|
<span></span>  printf(&quot;%dつ目の値段は%d円です。\n&quot;,i,n)
<span></span>  i += 1
<span></span>end

</pre>
</body>
</html>