C160 发表于 2021-3-15 22:47:47

大佬看看我

Scanf()==1表示的是什么意思{:10_269:}{:10_269:}

海-啵啵鱼 发表于 2021-3-16 15:04:57

那我来看看你吧,这个其实要你看scanf()这个函数的原型去看他的返回值了,你可以参考这个网站: https://www.cplusplus.com/reference/cstdio/scanf/

有用的信息就是return value :
Return Value
On success, the function returns the number of items of the argument list successfully filled. This count can match the expected number of items or be less (even zero) due to a matching failure, a reading error, or the reach of the end-of-file.

If a reading error happens or the end-of-file is reached while reading, the proper indicator is set (feof or ferror). And, if either happens before any data could be successfully read, EOF is returned.

If an encoding error happens interpreting wide characters, the function sets errno to EILSEQ.
意思就是说,如果成功会返回成功输入的个数,scanf() == 1,就说明成功输入了一项。

海-啵啵鱼 发表于 2021-3-16 15:09:20

成功输入了一项,这个你要看scanf()这个函数的返回值,也就是return value,百度一下就有了一般
页: [1]
查看完整版本: 大佬看看我