记录详情

Compile Error

/in/foo.c:1:1: warning: data definition has no type or storage class
    1 | n=int(input('请输入学校需要购买的几种图书:'))
      | ^
/in/foo.c:1:1: warning: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
/in/foo.c:1:3: error: expected expression before 'int'
    1 | n=int(input('请输入学校需要购买的几种图书:'))
      |   ^~~
/in/foo.c:1:13: warning: character constant too long for its type
    1 | n=int(input('请输入学校需要购买的几种图书:'))
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/foo.c:4:19: warning: character constant too long for its type
    4 |     p=float(input('请输入购买的第'+str(i+1);'种图书价格))
      |                   ^~~~~~~~~~~~~~~~
/in/foo.c:4:45: warning: missing terminating ' character
    4 |     p=float(input('请输入购买的第'+str(i+1);'种图书价格))
      |                                             ^
/in/foo.c:4:45: error: missing terminating ' character
    4 |     p=float(input('请输入购买的第'+str(i+1);'种图书价格))
      |                                             ^~~~~~~~~~~~~~~
/in/foo.c:5:9: warning: data definition has no type or storage class
    5 |         amounnt=int(input('请输入该书的数量:')
      |         ^~~~~~~
/in/foo.c:5:9: warning: type defaults to 'int' in declaration of 'amounnt' [-Wimplicit-int]
/in/foo.c:5:17: error: expected expression before 'int'
    5 |         amounnt=int(input('请输入该书的数量:')
      |                 ^~~
/in/foo.c:5:27: warning: character constant too long for its type
    5 |         amounnt=int(input('请输入该书的数量:')
      |                           ^~~~~~~~~~~~~~~~~~~~
/in/foo.c:11:7: warning: character constant too long for its type
   11 | print('需要支付的总费用是(元):',s)
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~

信息

递交者
类型
递交
比赛
信息技术通识练习题
语言
C
递交时间
2025-05-19 18:00:50
评测时间
2025-05-19 18:00:50
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes