FZU 2102 Solve equation Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Practice Description You are given two positive integers A and B in Base C. For the equation: A=k*B+d We know there always existing many non-nega…
C Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice FZU 2102 Description You are given two positive integers A and B in Base C. For the equation: A=k*B+d We know there always existing many non-negativ…
进制转化类题目类型: 代码详解及注释解答: //进制转化问题 #include <bits/stdc++.h> using namespace std; int main(){ // 1.反序数 123->321 // int n; // int sn = 0;//存取反序数 // scanf("%d", &n); // while( n!=0 ){ // sn = sn * 10; // sn += (n%10);//求出最后一位,即123的3 // n…
P1017进制转化 也不知道为啥,这么简单的题困扰了我这么长时间 #include<cstdio> using namespace std; int m; //被除数= 除数*商 + 余数 = 除数 *(商 + 1) + (余数 - 除数); void cal(int n) { if (n == 0) return; int p = n % m; n /= m; if (p < 0) p -= m, n++; cal(n); if (p <= 9) printf("%d&…