Last active
February 19, 2016 23:40
-
-
Save zenito9970/113468fb155775eb7d2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
import std.array; | |
import std.string; | |
import std.conv; | |
class iostream { | |
string[] s = new string[0]; | |
uint i = 0; | |
string getline() { | |
return chomp(readln()); | |
} | |
string next() { | |
if(i < s.length) return s[i++]; | |
string st = getline(); | |
while(st == "") st = getline(); | |
s = split(st); | |
i = 0; | |
return next(); | |
} | |
T next(T)() { | |
return to!T(next()); | |
} | |
} | |
void main() { | |
iostream ios = new iostream(); | |
int a = ios.next!int(); | |
int b = ios.next!int(); | |
writeln(a + b); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment