文件名称:badCoin
介绍说明--下载内容均来自于网络,请自行研究使用
给定一组硬币,共N枚,其中N-1枚是好的,1枚是坏的。所有好的硬币都有同样的重量,坏的硬币的重量与好的硬币不同,且有一枚好的硬币被做上标记。
编写一个程序,对于给定N和K,确定能否用最多K次的天平,找出那个坏的硬币。如果可以输出"POSSIBLE" ,否则输出"IMPOSSIBLE"。
-Given a set of coins, a total of N pieces, N-1 pieces is good, one bad. All the good coins have the same weight, the weight of bad coin with good coin, and there is a good coin flag. Write a program to determine whether to use a maximum of K times the balance for a given n and k, identify the bad coin. If the output " Possible" , otherwise output " Impossible" .
编写一个程序,对于给定N和K,确定能否用最多K次的天平,找出那个坏的硬币。如果可以输出"POSSIBLE" ,否则输出"IMPOSSIBLE"。
-Given a set of coins, a total of N pieces, N-1 pieces is good, one bad. All the good coins have the same weight, the weight of bad coin with good coin, and there is a good coin flag. Write a program to determine whether to use a maximum of K times the balance for a given n and k, identify the bad coin. If the output " Possible" , otherwise output " Impossible" .
(系统自动生成,下载前可以参看下载内容)
下载文件列表
data.out
badCoin.c
data.in