校舍分配方法 [英] School House Allocation Method
问题描述
正在尝试开发一个事件管理系统,该系统将自动将学生分配到房屋中.
我有以下数据
门牌号码
学生人数
任何人都可以提出一个想法??????
这个主意应该是.
如果门牌号是4(A,B,C,D),学生号是100,我需要按以下方式分配学生
A B C D
1 2 3 4
5 6 7 8
. . . .
. . . .
请提出一种算法...我处于绝望的境地...这就是为什么..
Am trying to develop an event management system which will allocate students automatically to a house .
I have the following data with me
House Number
Students Number
Can anyone suggest an Idea ??????
The idea should be .
if the house number is 4 (A,B,C,D)and students number is 100 i need to allocate students as the following
A B C D
1 2 3 4
5 6 7 8
. . . .
. . . .
please suggest an algorithm ...I am in a desperate situation...thats is why..
推荐答案
<br />
int currentStudent = 0;<br />
int currentHouse = 0;<br />
<br />
for(int i = 0;i<100;i++){<br />
MoveStudent(currentHouse,currentStudent);<br />
currentStudent += 1;<br />
currentHouse += 1;<br />
if (currentHouse >= 4){<br />
currentHouse = 0;<br />
}<br />
}<br />
这不是火箭科学.
this isn''t rocket science.
这篇关于校舍分配方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!