c语言简单问题求解
#include<stdio.h>#define FQ 3.7
#define JL 7
#define XQ 1.3
#define KXC 8
#define YCONG 2.4
#define YCAI 9
#define HG 6.3
#define BLB 0.5
int main()
{
float price;
price=(2*FQ+1*KXC+1*YCAI)*0.5;
printf("小明需要支付%.2f\n",price);
price=(3*XQ+0.5*YCONG+5*HG)*0.5;
printf("小红需要支付%.2f\n",price);
price=(10*HG+20*BLB)*0.5;
printf("小甲鱼需要支付%.2f\n",price);
return 0;
}
结果是这样发的
C:\Users\yfj\Desktop\C语言作业\S1E5.3 file not recognized: File format not recognized (this usually means GCC does not like a file extension)
collect2: ld returned 1 exit status
我是个新手有人能告诉我为什么吗,求求了 源文件的后缀名要用 .c isdkz 发表于 2022-3-22 11:34
源文件的后缀名要用 .c
dev也需要吗?
LXTTY 发表于 2022-3-22 12:59
dev也需要吗?
对呀,dev 也是用 gcc 来编译,gcc 需要通过扩展名来判断你的代码是 c 的还是 c++ 的 isdkz 发表于 2022-3-22 13:00
对呀,dev 也是用 gcc 来编译,gcc 需要通过扩展名来判断你的代码是 c 的还是 c++ 的
知道了,谢谢
页:
[1]