彭阿芸
5 years ago
紀錄
latest #11
立即下載
彭阿芸
5 years ago
#include <stdio.h>
#include <stdlib.h>

/run this program using the console pauser or add your own getch, system("pause") or input loop/

int main(int argc, char *argv[]) {
char gname[16];
float price,money;
int num;
printf("輸入貨物品名:");
彭阿芸
5 years ago
gets(gname);
printf("輸入單價:");
scanf("%f",&price);
printf("輸入數量:");
scanf("%d",&num);
money=price*num;
printf("\n");
printf("品名:\t\t單價\t數量\t金額\n");
printf("\t\t:%f\n",price);
printf("\t\t:%d\n",num);
printf("\t\t:%.1f\n\n",money); system("PAUSE"); return 0; }
彭阿芸
5 years ago
我討厭c語言
彭阿芸
5 years ago
back to top