习题6(6.3)

来源:互联网 发布:常客网络创新有限公司 编辑:程序博客网 时间:2024/06/16 00:59
#include <stdio.h>#include <stdlib.h>int main(){    int x=1,find=0;    for(x=1;!find;x++)    {        if(x%2==1&&x%3==2&&x%5==4&&x%6==5&&x%7==0)        {            printf("x=%d\n",x);            find=1;        }    }    return 0;}

这里写图片描述

知识点:for循环的使用

心得体会:写程序时要特别注意使用条件的先后顺序