c语言问题求助急急急!!!在线等

来源:百度知道 编辑:UC知道 时间:2024/06/16 14:37:03
main()
{
int a,b,c,i=1;
scanf("%d%d",&a,&b);
wlile(i>0)
{if(a*i%b==0) break;
i++;
}
c=a*i;
printf("c=%d",c);
}
error statement missing 错哪了?

wlile-> while

补充一下
你这个函数作用
#include <stdio.h>
main()
{
int a,b,c,i=1;
scanf("%d%d",&a,&b);
while(i>0)
{if(a*i%b==0) break;
i++;
}
c=a*i;
printf("c=%d",c);
}
这样至少编译通过

#include <stdio.h> /*加个这个*/
main()
{
int a,b,c,i=1;
scanf("%d,%d",&a,&b); /*"%d,%d"之间加一个逗号 例如要输入 10,9 然后回车键*/
while(i>0) /*while写错了*/
{if(a*i%b==0) break;
i++;
}
c=a*i;
printf("c=%d",c);
}

你的while写错了。你写的是wlile。另外你也没加#include<stdio.h>

什么意思?这个程序好象没什么问题哦。