
注意一下,当需求大于所有库存的情况
#include <stdio.h>
#define MAX_N 1000 /* 月饼最大种类数 */
int N; /* 种类 */
float demand; /* 需求量 */
typedef struct mooncake{
float inventory; /* 库存量 */
float price; /* 单价 */
}mooncake;
struct mooncake nmc[MAX_N]; /* N种月饼的信息 n moon cake */
void read_info();
void print_income();
int getMaxP();
/******* 读入月饼种类数,需求量,以及读入N中月饼的库存和总售价,并计算单价 ********/
void read_info(){

最低0.47元/天 解锁文章
3131

被折叠的 条评论
为什么被折叠?



