Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #define N 10
  5. int main(void)
  6. {
  7. char str_tot[50], str_parz[10];
  8. int i = 0, boolean = 0;
  9. do
  10. {
  11. printf("Inserire una parola:\t");
  12. scanf_s("%s", str_parz, sizeof(str_parz));
  13. if (strcmp(str_parz, "fine") != 0)
  14. {
  15. strcat(str_tot, str_parz);
  16. strcat(str_tot, "");
  17. }
  18. else
  19. {
  20. boolean = 1;
  21. }
  22. } while (boolean != '1' || strlen(str_tot) < 50);
  23. printf("%s\n", str_tot);
  24. system("pause");
  25. return 0;
  26.  
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement