Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- void copy(char* a,char* b);
- void sl(char* a, char* b, char* c);
- int main()
- {
- char a[100];
- char b[100];
- fgets(a,99,stdin);
- fgets(b,99,stdin);
- char copy_str[100];
- char sli[200];
- copy(a,copy_str);
- for (size_t i = 0; i < strlen(copy_str); i++){
- printf("%c",copy_str[i]);
- }
- printf("\n");
- sl(a,b,sli);
- for (size_t i = 0; i < strlen(sli); i++){
- printf("%c",sli[i]);
- }
- printf("\n");
- return 0;
- }
- void copy(char* a, char* b)
- {
- int o = 0;
- for(size_t i = 0; i < strlen(a); i++){
- if(isprint(a[i])){
- b[o] = a[i];
- o++;
- }
- }
- b[o] = '\0';
- }
- void sl(char* a, char* b, char* c){
- int o = 0;
- for (size_t i = 0; i < strlen(a); i++){
- if(isprint(a[i])){
- c[o] = a[i];
- o++;
- }
- }
- for (size_t i = 0; i < strlen(b); i++){
- if(isprint(b[i])){
- c[o] = b[i];
- o++;
- }
- }
- c[o] = '\0';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement