Created
October 13, 2013 14:25
-
-
Save MaratB/6962921 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <conio.h> | |
#include <stdio.h> | |
#include <string.h> | |
main(){ | |
char s[80], | |
a[80]="Привет, "; | |
int n=0, len; | |
printf("Введите фамилию и имя: \n"); | |
gets(s); | |
while ((s[n] != ' ') && (s[n] != '\0')) | |
n++; | |
if (s[n] != ' '){ | |
printf("Неверная строка!"); | |
return 1; | |
} | |
strcat(a, s+n+1); | |
strcat(a, " "); | |
len = strlen(a); | |
strncat(a, s, n); | |
strcat(a, "!"); | |
puts(a); | |
getch(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment