C++经典编程题目(十五)真假硬币

设有8枚硬币a,b,c,d,e,f,g,h,其中有一枚硬币是伪造的。 真伪硬币的区别仅是重量不一样,可能重,可能轻。今要求以天平为工具,用最少的 比较次数挑出伪造硬币,并鉴定它是重仍是轻。 #include <stdio.h> #include <iostream> #include <time.h> using namespace std; #define N 8 #define T 1
相关文章
相关标签/搜索