#include #include #include int main(int argc, char const *argv[]) { int i = 0; while(argv[1][i]){ printf("%c\n",argv[1][i] ); i++; } int len = i; int output = 0; int pownum4 = 1; int pownum10 = 1; for(int i=len-1;i>=0;i--){ int digit = atoi(&argv[1][i]) / pownum10; int temp = digit * pownum4; // printf("%c\n",argv[1][i] ); // printf("%i\n",temp ); output += temp; pownum4 = pownum4 * 4; pownum10 = pownum10 * 10; } std::string outstr = ""; bool flg = true; if(output%3==0){ outstr += "Fizz"; flg = false; } if(output%5==0){ outstr += "Buzz"; flg = false; } if(flg){ printf("%i\n", output); return 0; } else{ printf("%s\n",outstr.c_str() ); return 0; } }