<div dir="ltr">Hey there,<div><br></div><div>I am pretty sure I am messing up, but can't figure out really.</div><div><br></div><div>Here is what I do </div><div><br></div><div><div>-module(solution).</div><div><br></div><div>-export([main/0]).</div><div><br></div><div>main() -></div><div> Input = read_input([]),</div><div> [S | X] = Input,</div><div> io:format("S=~p, X=~p~n", [S, X]),</div><div> repeat(S, X).</div><div><br></div><div>read_input(Input) -></div><div> case io:fread("", "~d") of</div><div> {ok, [N]} -> read_input([N | Input]);</div><div> _ -> [lists:reverse(Input)]</div><div> end.</div></div><div><br></div><div><br></div><div>and when I run it, I get </div><div><p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">5> c(solution). </p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">solution.erl:20: Warning: function string_to_integer_list/1 is unused</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">{ok,solution}</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">6> solution:main().</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">2</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">3</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">4</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">5</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">.</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">S=[2,3,4,5], X=[]</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">ok</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54)">7> </p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(131,148,150);background-color:rgb(2,43,54);min-height:15px"><br></p></div><div>What's wrong here?</div><div><br></div><div>Thanks</div></div>