A+B: Difference between revisions

Content added Content deleted
(Added a V implementation)
m (fixed V to point to correct lang (title vlang in rosetta code) and re-ordered it)
Line 4,518: Line 4,518:
path: ~path; ^|C\~& ~=`.-~; ^|T/~& '.out'!]</lang>
path: ~path; ^|C\~& ~=`.-~; ^|T/~& '.out'!]</lang>


=={{header|V}}==
vlang.io
<lang v>import os

fn main() {
mut a := 0
mut b := 0
text := os.get_raw_line()
values := text.split(' ')
a = values[0].int()
b = values[1].int()
println('$a + $b = ${a+b}')
}</lang>
Read from stdin
{{out}}
<pre>
Input Output
2 2 2 + 2 = 4
3 2 3 + 2 = 5
</pre>
=={{header|Vala}}==
=={{header|Vala}}==
Read from stdin while program running:
Read from stdin while program running:
Line 4,662: Line 4,638:


End Module</lang>
End Module</lang>

=={{header|Vlang}}==
<lang vlang>import os

fn main() {
mut a := 0
mut b := 0
text := os.get_raw_line()
values := text.split(' ')
a = values[0].int()
b = values[1].int()
println('$a + $b = ${a+b}')
}</lang>
Read from stdin
{{out}}
<pre>
Input Output
2 2 2 + 2 = 4
3 2 3 + 2 = 5
</pre>


=={{header|Wee Basic}}==
=={{header|Wee Basic}}==