#include <stdio.h>

int main() { int num, qty; char name[20]; float cost, price, discount;

printf('请输入商品编号:');
scanf('%d', &num);
printf('请输入商品名称:');
scanf('%s', name);
printf('请输入商品进价:');
scanf('%f', &cost);
printf('请输入商品售价:');
scanf('%f', &price);
printf('请输入商品折扣:');
scanf('%f', &discount);
printf('请输入商品数量:');
scanf('%d', &qty);

printf('

商品编号:%d 商品名称:%s 商品进价:%.2f 商品售价:%.2f 商品折扣:%.2f 商品数量:%d ', num, name, cost, price, discount, qty);

return 0;

}

C语言程序:输入商品信息并显示

原文地址: https://www.cveoy.top/t/topic/omTH 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录