我想检查用户是否输入了内容。

huangapple go评论70阅读模式
英文:

I want to check whether the user has entered something

问题

a] 如何检查用户是否已经在 scanf 语句中输入了内容。

b] 如何重复运行代码的一部分,而不使用 goto 函数,或者有没有替代 goto 的方法。

英文:

I am facing a problem that is is follows:
a] How to check whether the user has entered something against the scanf statement.
b] How to run a part of code repeatedly without goto function or what is the replacement for goto.

答案1

得分: 1

a] scanf()返回成功扫描和分配的输入数量。

b] 如何重复运行一部分代码,而不使用goto函数或替代goto。

循环。

英文:

> a] How to check whether the user has entered something against the scanf statement.

scanf() returns the number of successful inputs scanned and assigned.

> b] How to run a part of code repeatedly without goto function or what is the replacement for goto.

Loops.

huangapple
  • 本文由 发表于 2020年1月3日 20:38:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/59578789.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定