#define_CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<string.h>#include<stdlib.h>#defineMAXKEY1000typedefstructInfo_s{int num;char name[30];int age;char addr[30];}Info_t,*pInfo_t;//哈希函数inthash(char*key){int h =0, g;while(*key){h =(h <<4)+*key++;g = h &0xf0000000;if(g)h ^= g >>24;h &=~g;}return h % MAXKEY;//返回值范围: 0~MAXKEY-1}intmain(){//建立哈希表pInfo_t hashTable[MAXKEY]={NULL};Info_t infoArr[]={1001,"Wuyifan",30,"Canada",1003,"Liuhuaqiang",45,"Shijiazhuang",1005,"Zhengshuang",30,"Shenyang",1007,"Mayun",50,"Hangzhou"};//准备好的数据插入哈希表for(int i =0; i <sizeof(infoArr)/sizeof(Info_t);++i){int hashValue =hash(infoArr[i].name);hashTable[hashValue]=&infoArr[i];}//查找char name[30];while(scanf("%s", name)!=EOF){if(hashTable[hash(name)]==NULL){printf("%s is not in array!\n", name);}else{printf("%d %s %d %s\n", hashTable[hash(name)]->num,hashTable[hash(name)]->name,hashTable[hash(name)]->age,hashTable[hash(name)]->addr);}}}
市面上5种常见的电商模式: B2B模式 B2B(business to business),是指商家与商家建立的商业关系。如:阿里巴巴
B2C模式 B2C(business to consumer),商对客模式,商业零售。直接面向消费者销售产品…