C++,为什么这段程序输出没有结果

#include<iostream>using namespace std;int main(){ int step; for(step=1;step>1;step++) { if(step%2==1 && step%3==2 && step%5==4 && step%6==5 && step%7==0) { cout<<step; break; } }}
2026年09月21日 14:04
有2个网友回答
网友(1):

for(step=1;step>1;step++)
这个循环有问题

网友(2):

for(step=1;;step++)