kykint

Exit on input 'exit'

Showing 1 changed file with 7 additions and 1 deletions
#include <stdio.h>
#include <string.h>
int main(void) {
printf("Input a string\n");
printf("Will exit on input \"exit\"\n");
while (1) {
char str[50];
scanf("%s", str);
printf("%s\n", str);
if (strcmp(str, "exit") == 0) {
break;
} else {
printf("%s\n", str);
}
}
return 0;
......