Sha256: 590eb04f5c5a4d0ff39f33c4a6b8e8149da41bbd14837b49800ba9db0787cfca
Contents?: true
Size: 685 Bytes
Versions: 268
Compression:
Stored size: 685 Bytes
Contents
#include "raindrops.h" #include "stdio.h" #include "string.h" #define PLING_FACTOR 3 #define PLANG_FACTOR 5 #define PLONG_FACTOR 7 char *convert(char *buffer, int buffer_length, int drops) { memset(buffer, '\0', sizeof(char) * buffer_length); if ((drops % PLING_FACTOR != 0) && (drops % PLANG_FACTOR != 0) && (drops % PLONG_FACTOR != 0)) { snprintf(buffer, buffer_length, "%d", drops); } else { snprintf (buffer, buffer_length, "%s%s%s", drops % PLING_FACTOR == 0 ? "Pling" : "", drops % PLANG_FACTOR == 0 ? "Plang" : "", drops % PLONG_FACTOR == 0 ? "Plong" : ""); } return buffer; }
Version data entries
268 entries across 268 versions & 1 rubygems