Evens只输入 [英] Evens only input
问题描述
大家好,
我试图想出一种方法,即使只允许在C ++中输入。有没有我在某处看不见的东西?任何帮助都提前得到赞赏。
谢谢,
Straub
Hello all,
I am trying to figure out a way to allow even only input in C++. Is there soemthing that I''m not seeing somewhere? Any help is appreciated in advance.
Thanks,
Straub
推荐答案
Hello all,
我试图想出一种方法,即使只允许在C ++中输入。有没有我在某处看不见的东西?提前感谢任何帮助。
谢谢,
Straub
Hello all,
I am trying to figure out a way to allow even only input in C++. Is there soemthing that I''m not seeing somewhere? Any help is appreciated in advance.
Thanks,
Straub
我不能了解你的问题。
你可以提供更多解释
Raghuram
I am not able to understand ur question.
can u provide more explanation
Raghuram
大家好,
我试图找到一种方法,即使只允许在C ++中输入。有没有我在某处看不见的东西?任何帮助都提前得到赞赏。
谢谢,
Straub
Hello all,
I am trying to figure out a way to allow even only input in C++. Is there soemthing that I''m not seeing somewhere? Any help is appreciated in advance.
Thanks,
Straub
如果我在预测正确地说,您是否希望用户仅输入偶数值作为输入?
问候
If I am predicting correctly, do you want user to enter only even values as an input?
Regards
大家好,
我试图想出一种方法,即使只允许在C ++中输入。有没有我在某处看不见的东西?提前感谢任何帮助。
谢谢,
Straub
Hello all,
I am trying to figure out a way to allow even only input in C++. Is there soemthing that I''m not seeing somewhere? Any help is appreciated in advance.
Thanks,
Straub
你可以使用MOD运算符检查输入是偶数还是奇数。如果是奇数,您可以决定应该采取什么行动。要么您没有对输入做任何事情,要么强制输入为偶数。
You can use the MOD operator to check if the input is even or odd. If it is odd, you can decide what action should be taken. Either you don''t do anything with the input or you force the input to an even number.
这篇关于Evens只输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!