Sha256: c5253309c2c4b6ed404677591e2f4c91d3158f5656792b40377e4e74e33173f9
Contents?: true
Size: 477 Bytes
Versions: 108
Compression:
Stored size: 477 Bytes
Contents
#include "raindrops.h" #include "stdio.h" #include "string.h" #include <stdlib.h> char *convert(char result[], int drops) { if (drops % 3 == 0) { strcat(result, "Pling"); } if (drops % 5 == 0) { strcat(result, "Plang"); } if (drops % 7 == 0) { strcat(result, "Plong"); } if (strlen(result) == 0) { char drops_string[12] = "\0"; sprintf(drops_string, "%d", drops); strcat(result, drops_string); } return result; }
Version data entries
108 entries across 108 versions & 1 rubygems