foo.c: In function 'main':
foo.c:6:9: error: 'st' undeclared (first use in this function)
6 | st = 1;
| ^~
foo.c:6:9: note: each undeclared identifier is reported only once for each function it appears in
foo.c:7:5: error: 'total' undeclared (first use in this function)
7 | total =0;
| ^~~~~
foo.c:8:6: error: invalid preprocessing directive #\U00007b2c\U00004e00\U0000672c\U00004e66
8 | #第一本书 :请输入购买的第1种图书价格(元):18 ,请输入该书的数量:50
| ^~~~~~~~
foo.c:9:17: warning: implicit declaration of function 'comput' [-Wimplicit-function-declaration]
9 | total = comput(18,50)
| ^~~~~~
foo.c:11:2: error: invalid preprocessing directive #\U00007b2c\U00004e8c\U0000672c\U00004e66
11 | #第二本书 :请输入购买的第2种图书价格(元):22,请输入该书的数量:8
| ^~~~~~~~
foo.c:9:30: error: expected ';' before 'total'
9 | total = comput(18,50)
| ^
| ;
......
12 | total = total+comput(22,8)
| ~~~~~
foo.c:14:2: error: invalid preprocessing directive #\U00007b2c\U00004e09\U0000672c\U00004e66
14 | #第三本书 :请输入购买的第3种图书价格(元):16,请输入该书的数量:55
| ^~~~~~~~
foo.c:16:2: error: invalid preprocessing directive #\U00008f93\U000051fa
16 | #输出 总金额
| ^~~~
foo.c: At top level:
foo.c:21:3: error: invalid preprocessing directive #\U00005b9a\U00004e00\U00004e2a\U00008ba1\U00007b97\U000051fd\U00006570\U000067d0\U0000672c\U00004e66\U00007684\U00006570\U000091cf\U0000572810\U0000672c\U00004ee5\U00004e0b\U00004e0d\U00006253\U00006298\U0000ff0c10\U0000672c\U00004ee5\U00004e0a\U0000ff08\U00005305\U0000542b10\U0000ff09\U00006bcf\U0000672c\U000062539\U00006298
21 | # 定一个计算函数某本书的数量在10本以下不打折,10本以上(包含10)每本打9折。
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.c:22:2: error: invalid preprocessing directive #\U00008bf7\U00007f16\U00005199\U00004e00\U00004e2a\U00007a0b\U00005e8f\U0000ff0c\U00004f9d\U00006b21\U00008f93\U00005165\U00005b66\U00006821\U00008d2d\U00004e70n\U000079cd\U000056fe\U00004e66\U000053ca\U00005176\U00006570\U000091cf\U0000ff0c\U00008f93\U000051fa
22 | #请编写一个程序,依次输入学校购买n种图书及其数量,输出
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.c:23:2: error: invalid preprocessing directive #\U00009700\U00008981\U0000652f\U00004ed8\U00007684\U0000603b\U00008d39\U00007528
23 | #需要支付的总费用。保留1位小数。
| ^~~~~~~~~~~~~~~~
foo.c:24:5: error: unknown type name 'def'
24 | def comput(price , amount ):
| ^~~
foo.c: In function 'comput':
foo.c:24:32: error: expected declaration specifiers before ':' token
24 | def comput(price , amount ):
| ^
foo.c:24:9: warning: type of 'price' defaults to 'int' [-Wimplicit-int]
24 | def comput(price , amount ):
| ^~~~~~
foo.c:24:9: warning: type of 'amount' defaults to 'int' [-Wimplicit-int]
foo.c:31: warning: control reaches end of non-void function [-Wreturn-type]
[Hydro](https://hydro.ac)提供评测服务