learning-cc4e

Solution to https://cc4e.com/. If you copy these you're not right in the head.
git clone https://kaka.farm/~git/learning-cc4e
Log | Files | Refs

solution.c (345B)


      1 #include <stdio.h>
      2 #include <string.h>
      3 int main() {
      4     char line[1000];
      5     char keep[1000];
      6 
      7   if (gets(line) != NULL) {
      8     printf("%s\n", line);
      9     strcpy(keep, line);
     10   } else {
     11     return;
     12   }
     13 
     14   while (gets(line) != NULL) {
     15     if (strcmp(keep, line) == 0) {
     16       continue;
     17     }
     18     strcpy(keep, line);
     19     printf("%s\n", line);
     20   }
     21 }