#include <stdio.h>
#include <string.h>
void r(char str[])
{
int len=strlen(str);
str[len-1]=0;
}
int main() {
char str[100];
printf("문자열 입력: ");
fgets(str, sizeof(str), stdin);
printf("길이: %ld, 내용: %s \n", strlen(str), str);
r(str);
printf("길이: %ld, 내용: %s \n", strlen(str), str);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: