Skip to content

Instantly share code, notes, and snippets.

@MaratB
Created October 13, 2013 14:25
Show Gist options
  • Save MaratB/6962921 to your computer and use it in GitHub Desktop.
Save MaratB/6962921 to your computer and use it in GitHub Desktop.
#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