- #include <stdio.h>
- #define BASE 7
- unsigned long int BASEto10(unsigned long int a);
- unsigned long int DECtoBASE(unsigned long int a);
- int main(void) {
- unsigned long int s,d;
- return 0;
- }
- unsigned long int BASEto10(unsigned long int a) {
- if (a == 0) return 0;
- if (a < 4266666666) {
- int k=1;
- long int a10=0;
- while (a) {
- a10 += k*(a%10);
- k *= BASE;
- a /= 10;
- }
- return a10;
- }
- return 0;
- }
- unsigned long int DECtoBASE(unsigned long int a) {
- if (a == 0) return 0;
- if (a < 4266666666)
- return (a % BASE) + 10 * DECtoBASE(a / BASE);
- return 0;
- }