Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Array = { 1214, 211, 333, 436, 33 };
- int ArraySub = Array;
- int temp;
- //ソート
- for (int i = 0; i < Array.LENGTH; i++)
- {
- for (int j = Array.LENGTH - 1; j >= i; j--)
- {
- if (ArraySub[j - 1] > ArraySub[j])
- {
- temp = ArraySub[j - 1];
- ArraySub[j - 1] = ArraySub[j];
- ArraySub[j] = temp;
- }
- }
- }
- for (int i = 0; i < Array.Length; i++)
- {
- for (int j = 0; j < ArraySub.Length; j++)
- {
- if (Array[i] == ArraySub[j])
- {
- switch (i)
- {
- case 1:
- //ここでvarに教科を追加
- break;
- case 2:
- //ここでvarに教科を追加
- break;
- case 3:
- //ここでvarに教科を追加
- break;
- case 4:
- //ここでvarに教科を追加
- break;
- case 5:
- //ここでvarに教科を追加
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement