/*
.某商场某天的商品销售情况如下表所示,编程计算每种商品的销售额及所有商品的总销售额,并按表格形式输出。
commodity number unit price sale
television 5 5000
refrigerator 8 2200
washing machine 10 1100
water heater 3 860
microwave oven 6 800
*/
#include<stdio.h>
void main()
{
char commodity[5]={"television","refrigerator","washing machine","water heater","microwave oven"];
int number[5]={5,8,10,3,6};
int unit_price[5]={5000,2200,1100,860,800};
long sale[5];
for(int i=0;i++;i<5)
{
sale[i]=number[i]*unit_price[i];
}
printf("commodity number unit price sale");
for(int i=0;i++;i<5)
{
printf("%10c,%10d,%10d,%10ld",commodity[i],number[i],unit_price[i],sale[i];
}
怎么改啊