#include<stdio.h>
#include<math.h>
int main()
{
int a,b,c,i;
scanf("%d %d",&a,&b);
for(i=0;i<=a;i++)
{
if(a%i==0 && b%i==0)
c=i;
}
printf("%d",c);
}
Illegal instruction (core dumped)
Illegal instruction (core dumped)
Illegal instruction (core dumped)
#include
#include
int main()
{
int a,b,c,i;
scanf("%d %d",&a,&b);
for(i=0;i<=a;i++)
{
if(a%i==0 && b%i==0)
c=i;
}
printf("%d",c);
}
Illegal instruction (core dumped)
Illegal instruction (core dumped)
Illegal instruction (core dumped)
不能除以0
#include
#include
int main()
{
int a,b,c,i;
scanf("%d %d",&a,&b);
for(i=0;i<=a;i++)
{
if(a%i==0 && b%i==0)
c=i;
}
printf("%d",c);
}
Illegal instruction (core dumped)
Illegal instruction (core dumped)
Illegal instruction (core dumped)
不能除以0
謝謝