Created
February 25, 2017 11:53
-
-
Save xreiju/0a8331599bc9cf1f1e79910b9b328a2c 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, std.format; | |
class KNH { | |
private bool _burn = false; | |
void burn() { | |
this._burn = true; | |
} | |
} | |
void main() { | |
int k = 10; | |
KNH[] knhList; | |
for(int i = 0; i < k; i++) knhList ~= new KNH; | |
foreach(v; knhList) { | |
v.burn(); | |
} | |
writeln(format("%s KNH(s) burned", k)); | |
} | |
//10 KNH(s) burned |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment