Programming program

xiaoxiao2021-04-10  387

For example, the school should work according to the students' enrollment scores; it is the first place in one. The second place is in two. . . 600 students compiled a class. Next to the tenth place is the tenth class, the eleventh will be cheated 10 classes. The twelfth is composed of 9 classes. The thirteenth is compiled 8, and in this class. . . How to write this function

Below is a thought I wrote

// i is the student number; classnum: is 1-10for (i = 1; i <= 600, i ) / / total 600 students {IF ((i / 10)% 2 == 1) / / If (i / 10) is an odd number {classnum = (10-I% 10) 1; if (i% 10 == 0) ClassNum = 10 [Student i) Classnum class]} else // If (I / 10) is a non-odd number {classnum = (i% 10) IF (i% 10 = 0) classnum = 1 [Student i) Classnum class]}}

转载请注明原文地址:https://www.9cbs.com/read-133464.html

New Post(0)