Red de conocimiento informático - Consumibles informáticos - Maestro, ayúdeme a responder esta pregunta, programación en lenguaje C

Maestro, ayúdeme a responder esta pregunta, programación en lenguaje C

#includelt;iostreamgt;

#includelt;cmathgt;

#includelt;algorithmgt;

usando el espacio de nombres std;

int x, y, dd;

void text_gcd(int a, int b)

{

if(b==0)

{

x=1

y=0

dd=a; p>

else

{

text_gcd(b, ab

int t=x

x=y); ;

y=t-a/b*y;

}

}

int main()

{

int a[5], m[5], M, cnt=1, d

m[0]=23, m[1]=28, m[; 2]=33;

while(scanf("dddd",amp;a[0],amp;a[1],amp;a[2],amp;d)==4)

{

if(a[0]==-1amp;amp;a[1]==-1amp;amp;a[2]==-1amp;amp;d ==-1)

romper;

int j;

M=1

for(j=0; jlt; 3; j )

M*=m[j];

int ans=0

for(j=0; jlt; 3; j )

{

int t=M/m[j];

text_gcd(t, m[j]); =(ans t*x*a[j])M;

}

while(anslt;=d)

{

ans =M;

}

printf("Caso d: el siguiente pico triple ocurre en d días.\n", cnt, ans-d);

}

devuelve 0;

}