#include <iostream>
class Robot {
private:
    int sc;
    int save;
public:
    Robot() { sc = 0;save = 0;}
    void P() {sc++;}
    void D() {sc--;}
    
    void M() {sc = std::max(sc, save);}
    void S() {save = std::max(sc, save);}
    bool m(int B) {return (B > sc);}
    int G() { return sc; }
    
};

int main() {
    Robot h;
    loop:
    std::cout << h.G() << std::endl;
    
    if (h.m(3)) {h.P();goto loop;}
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: