问题描述
您好
我正在尝试构建一个可以转换当前时间表的工具,该时间表按4个课程*每年2个学期的安排(即4,4
I'm trying to build a tool that can convert a current timetable which is allocated in a 4 course * 2 Semester per year arrangement i.e. 4, 4
参加3门课程*每年安排3个学期,即3、3、3个安排.
To a 3 Course * 3 Semester per year arrangement i.e. 3, 3, 3 arrangement.
例如,如果要按照当前的4、4排列方式列出课程,例如
For example if were to list the courses out in the current 4, 4 arrangement like so
- Math1;数学2; Math3; Math4
- Math5;数学6; Math7; Math8
我希望该工具也能将其转换:
I'd expect the tool to convert it too:
- Math1;数学2; Math3
- Math4;数学5; Math6
- Math7;数学8;选修课
此刻,我只想要此功能-将添加到该功能以在某些条件下工作.如果可以的话,请帮助我.
At the moment i just want this functionality - Will add to the functionality to work under certain conditions. If you could please help me with this it would be much appreciated.
推荐答案
参加3门课程*每年安排3个学期,即3、3、3个安排.
To a 3 Course * 3 Semester per year arrangement i.e. 3, 3, 3 arrangement.
例如,如果要按照当前的 4、4安排列出课程,例如这样
For example if were to list the courses out in the current 4, 4 arrangement like so
- Math1;数学2; Math3; Math4
- Math5;数学6; Math7; Math8
我希望该工具也能将其转换:
I'd expect the tool to convert it too:
- Math1;数学2; Math3
- Math4;数学5; Math6
- Math7;数学8;选修课
在我看来,这更像是2X4的排列方式,而不是4x4.
它具有课程任务的外观和感觉以及气味.
所以我应该克制自己.但在其他人大喊之前:
"哦!问我!问我!"
我将为 * you * 抛出一些代码,以进行思考,调整,完善和改进.
希望它能刺激您的灰色细胞,而无需您做所有的工作.
It looks more to me like a 2X4 arrangement, not 4x4.
This has the look and feel - as well as the scent - of a course assignment.
So I should restrain myself. But before anyone else yells:
"Oh! Ask me! Ask me!"
I'll toss some code out for *you* to ponder over, adapt, refine, and improve.
Hopefully it will stimulate your grey cells without doing all the work for you.
int z = 0, zz = 0;
for (int x = 0; x <= a1.GetUpperBound(0); ++x)
{
for (int y = 0; y <= a1.GetUpperBound(1); ++y)
{
a2[z, zz] = a1[x, y];
if (++zz == a2.GetUpperBound(1) + 1) { ++z; zz = 0; }
}
}
a2[2, 2] = "Elective";
-韦恩
这篇关于时间表转换器帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!