Weekly Contest
限制 :
104
程式碼:
class Solution {
public:
string decToBinStr(int num) {
string result;
while (num > 0) {
int dd = num % 2;
num /= 2;
result = char(dd + '0') + result;
}
return result;
}
string convertDateToBinary(string date) {
int year, month, day;
stringstream cha;
cha << date;
cha >> year >> month >> day;
month = abs(month);
day = abs(day);
return decToBinStr(year) + "-" + decToBinStr(month) + "-" + decToBinStr(day);
}
};
限制 :
104
程式碼:
限制 :
104
程式碼:
限制 :
104
程式碼:
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up