SHARE
TWEET

Untitled

a guest Dec 6th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <locale.h>
  4. main()
  5. {
  6. setlocale(LC_ALL,"RUS");
  7. char slova[20],Prist[5],OP[6][20];
  8. int i=0,len,j=0,k,n;
  9. printf("Введите приставку:\n");
  10. gets(Prist);
  11. len=strlen(Prist);
  12. printf("Введите кол-во слов: \n");
  13. scanf("%d",&n);
  14. printf("Введите слова:\n");
  15. while (i<=n)
  16. {
  17. gets(slova);
  18. if (strncmp(slova,Prist,len)==0)
  19. {
  20. strcpy(OP[j],slova);
  21. j++;
  22. }
  23. i++;
  24. }
  25. printf("Ответ:\n");
  26. k=j;
  27. for (j=0;j<k;j++)
  28. puts(OP[j]);
  29. return 0;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top