SHARE
TWEET

Untitled

a guest Mar 18th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. int main(void){
  5.     char f1[20];
  6.     char f2[20];
  7.     char buff[40];
  8.     int i = 0, j = 0;
  9.     printf("Podaj pierwsze zdanie: ");
  10.     scanf("%s", &f1);
  11.     printf("Podaj drugie zdanie: ");
  12.     scanf(" %s", &f2);
  13.     printf("\n%s %d, %s %d\n", f1, strlen(f1), f2, strlen(f2));
  14.     while(i < strlen(f1) + strlen(f2) + 1){
  15.         if(i < strlen(f1)){
  16.             buff[i] = f1[i];
  17.         }
  18.         else{
  19.             buff[i] = f2[j];
  20.             j++;
  21.         }
  22.         i++;
  23.     }
  24.     printf("%s", buff);
  25.     return 0;
  26. }
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