#include<stdio.h>
int main()
{
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
int i,j,count;
for(i=a;i<=a*d;i+=a)
{for(j=b;j<=b*d;j+=b)
{if(i==j)continue;
count++;
}
for(j=c;j<=c*d;j+=c)
{if(i==j)continue;
count++;
}
count++;}
for(i=b;i<=b*d;i+=b)
{ for(j=c;j<=c*d;j+=c)
{if(i==j)
count--;
}
}
printf("%d",count-2*d*(d-1));
return 0;
}
标签:count,int,d%,11.1,++,continue,include From: https://blog.51cto.com/u_15758636/5815076