initial commit
This commit is contained in:
23
c/templates/ex.c
Normal file
23
c/templates/ex.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/* See GNUmakefile in following link for explanation
|
||||
* https://exercism.io/my/solutions/103b2f7d92db42309c1988030f5202c7
|
||||
*/
|
||||
#if defined UNIT_TEST || defined DEBUG
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef UNIT_TEST
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
int arg=1;
|
||||
resistor_band_t i[2];
|
||||
|
||||
for (; arg<ac-1; ++arg, ++arg) {
|
||||
*i=atoi(av[arg]);
|
||||
*(i+1)=atoi(av[arg+1]);
|
||||
printf("color(%d, %d)=%d\n", i[0], i[1], color_code(i));
|
||||
}
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user