从1到9这九个数中,任取三个数作为数组(a,b,c),且a<b<c,则不同的数组共有多少个?
楼上的答案多了,因为题目要求是1到9这9个数字,不包括0。这是一位OI天牛的源代码。 #include #include using namespace std; void prcs(int x) { int vd[10]; memset(vd, 0, sizeof(vd)); int y = x*x; int tx = x, ty = y; while (x != 0) { vd[x % 10] ; x /= 10; } while (y != 0) { ...全部
楼上的答案多了,因为题目要求是1到9这9个数字,不包括0。这是一位OI天牛的源代码。
#include #include using namespace std; void prcs(int x) { int vd[10]; memset(vd, 0, sizeof(vd)); int y = x*x; int tx = x, ty = y; while (x != 0) { vd[x % 10] ; x /= 10; } while (y != 0) { vd[y % 10] ; y /= 10; } for (int i=1; i if (vd[i] != 1) return; cout } int main() { for (int a=1; a for (int b=1; b for (int c=1; c prcs(a*100 b*10 c); system("pause"); return 0; } 567 * 567 = 321489 854 * 854 = 729316 如果对您有帮助,请记得采纳为满意答案,谢谢!祝您生活愉快! Vae团队招人!!!欢迎各位加入!!!走过路过不要错过!!!迅猛发展中!!!。收起