@vncpetrov/

IntegerToBase

C++

No description

fork
loading
Files
  • main.cpp

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.9459996327031872","path":"main.cpp","file":{"path":"main.cpp","content":{"asEncoding":{"base64":"I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPHN0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnN0cmluZyBpbnRlZ2VyVG9CYXNlKGludCwgaW50KTsKCmludCBtYWluKCkgewogIC8vIFRPRE86IEltcGxlbWVudCB0aGUgbWlzc2luZyBjb252ZXJzaW9uIGxvZ2ljCiAgCiAgcmV0dXJuIDA7Cn0KCnN0cmluZyBpbnRlZ2VyVG9CYXNlKGludCBudW1iZXIsIGludCB0b0Jhc2UpIHsKICBzdHJpbmcgcmVzdWx0ID0gIiI7CiAgd2hpbGUgKG51bWJlciAhPSAwKSB7CiAgICAvLyBUT0RPOiBJbXBsZW1lbnQgdGhlIG1pc3NpbmcgY29udmVyc2lvbiBsb2dpYwogIH0KICAgIAogIHJldHVybiByZXN1bHQ7Cn0="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include<iostream>
#include<string>
using namespace std;

string integerToBase(int, int);

int main() {
  // TODO: Implement the missing conversion logic
  
  return 0;
}

string integerToBase(int number, int toBase) {
  string result = "";
  while (number != 0) {
    // TODO: Implement the missing conversion logic
  }
    
  return result;
}