我应该编写一个 C while
语句,当 x
大于 10 且是 6 或 7 的倍数时继续。我只需要包含实际的 while
语句,而不是整个循环!
我知道这对你来说可能看起来很有趣,但这就是我到目前为止所拥有的。
#include<stdio.h>
int main(){
int x;
while (x > 10, x % 7 = 0 || x % 6 = 0) {
printf("%d\n", x);
}
}
最佳答案
逻辑上是&&
。作为运算符,,
是“忽略左侧结果”。
关于c - c语言中的while语句怎么写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30550414/