mirror of
https://github.com/nolongeractivemp3/shipthatcode-c.git
synced 2026-11-24 10:45:12 +01:00
18 lines
505 B
C
18 lines
505 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int main(void) {
|
|
/* Already done for you: read one line of text into name and drop the
|
|
Enter key from its end. The Strings lesson explains how this works. */
|
|
char name[256] = "";
|
|
if (fgets(name, sizeof name, stdin) == NULL) {
|
|
name[0] = '\0';
|
|
}
|
|
name[strcspn(name, "\r\n")] = '\0';
|
|
|
|
/* TODO: print the two lines described in the exercise.
|
|
Use a %s placeholder for name; do not type any name yourself. */
|
|
|
|
return 0;
|
|
}
|