luhaozhi2013 @ 2024-05-11 20:22:08
这道题我在Dev-C++上编译失败,显示: ‘i’ does not name a type, expected ‘;’ before ‘return’, expected primary-expression before ‘return’。 这是怎么回事???
by LHM_zs @ 2024-05-11 20:22:47
@luhaozhi2013 你发一下代码
by RainPPR5 @ 2024-05-11 20:25:06
‘i’ does not name a type, expected ‘;’ before ‘return’, expected primary-expression before ‘return’
有道翻译:
' i '没有指定类型,在' return '之前期望';',在' return '之前期望主表达式
换句话说,你好像没写分号。
by danlao @ 2024-05-11 21:01:04
@luhaozhi2013
i
没定义
return
前一行末尾没写 ;
return
前不能就加任何操作且用 ,
连接,如 ans++,return
。
by Missa @ 2024-05-11 21:22:03
by luhaozhi2013 @ 2024-05-12 09:58:24
@danlao 我明白了。