Home > Back-end >  The bosses of the optimal solution
The bosses of the optimal solution

Time:09-23

Enter today is week a few days and then enter a output after a few days of the week,,,, I began to learn C language I want to know is there a better algorithm
#include
Int main ()
{
Int I, j, k, m, n;
End:
Printf (" what day is it today \ n ");
The scanf (" % d ", & amp; I);
While (i<0 | | i> 7)
{
Printf (" please input the correct working days! \n");
Goto the end;
}
Printf (" do you want to know which day \ n ");
The scanf (" % d ", & amp; J);
M=j/7;
N=j % 7;
K=(I + n)/7;
If (m<1 & amp; & I + j<=7)
Printf (" % d % d days are week ", j, j + I);
Else if (n + i<7)
Printf (" % d days is the week after week % d % d ", j, m, n + I);
The else
Printf (" % d days is the week after week % d % d ", j, m, k);
return 0;
}
  • Related