Question 1:
We would like to assign rooms for students. Assume there are x students, each room could accommodate 6 students. Use one formula to find out how many rooms we needed in total.
Answer: (x+5)/6
Question 2:
Let x cycle move from 0 to 9.
#include<stdio.h>
int main()
{
int x,y,i;
i = 2; //i is the cycle times.
for (y = 0; y < i; ++y)
{
for (x = 0; x < 10; ++x)
{
x = x % 10;
printf("%d\n",x);
}
}
return 0;
}