| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 118369 | 梁颢城 | 十进制转d进制 | C++ | Wrong Answer | 70 | 0 MS | 252 KB | 320 | 2023-12-30 10:12:39 |
#include<bits/stdc++.h> using namespace std; int a[10010]; signed main(){ int n,d; cin >> n >> d; int sum = n; int cnt = 0; while(sum != 0){ a[cnt] = sum % d; sum = (sum - a[cnt])/d; cnt++; } for(int i = cnt-1; i >= 0;i--){ cout << a[i]; } if(n == 0){ cout << 0; } return 0; }