首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

关于数据结构算法解决方法

2012-03-18 
关于数据结构算法以下是一条公司出的题目,求答案:Data StructureGiving the following requirements:Favor

关于数据结构算法
以下是一条公司出的题目,求答案:
Data Structure
Giving the following requirements:
Favorite sport - enum(baseball, hockey, football, soccer, basketball)
Hours Training - number from 0 to 50
Favorite Team - enum(Canadiens, Nordiques)
Favorite color - enum(black, white, blue, red, yellow, green, brown, pink)

what would be the bit representationusing the most optimal algorithm of the following choices:
hocky, 7, canadiens, red

[解决办法]

C/C++ code
struct XXX{        char Sport :4;        char Color :4;        char Hours :6;        char Team  :1;}; 

热点排行