C: complex numbers + sum of multiples
This commit is contained in:
@@ -2,8 +2,13 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define STD(i) roster.students[i]
|
||||
#define NAME(i) roster.students[i].name
|
||||
/* V1: initial version
|
||||
* V2: removed useless static struct (was planned for a static list
|
||||
* of grades students, that I will not do).
|
||||
*/
|
||||
|
||||
#define STD(i) roster.students[i]
|
||||
#define NAME(i) roster.students[i].name
|
||||
#define GRADE(i) roster.students[i].grade
|
||||
|
||||
static roster_t roster;
|
||||
@@ -39,7 +44,7 @@ int add_student(char *s, uint8_t g)
|
||||
*/
|
||||
roster_t get_grade(uint8_t g)
|
||||
{
|
||||
static roster_t r;
|
||||
roster_t r;
|
||||
unsigned i, j=0;
|
||||
|
||||
for (i=0; i<roster.count && GRADE(i)<=g; ++i) {
|
||||
|
Reference in New Issue
Block a user