#include <iostream>
#include <stdio.h>
class FOR {
private:
int k = 0;
int j = 0;
int i = 0;
public:
FOR(int J,const char* H){
this->j = J;
};
int get(){
this->i = this->k;
return this->i;
};
bool loop(){
if (this->k < this->j) {
(this->k)++;
return true;
} else {
return false;
}
};
};
int main() {
FOR g(10,"^_^");
while (g.loop()) {
printf("%d:",g.get());
std::cout << "Hello world!" << std::endl;
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: