Skip to content

Instantly share code, notes, and snippets.

@zenito9970
Last active February 19, 2016 23:40
Show Gist options
  • Save zenito9970/113468fb155775eb7d2c to your computer and use it in GitHub Desktop.
Save zenito9970/113468fb155775eb7d2c to your computer and use it in GitHub Desktop.
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