Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #define MAX 30
  4. int main(){
  5. char s[MAX],s1[MAX],novi[MAX];
  6. int ds,ds1,p;
  7.  
  8.  
  9. gets(s);
  10. gets(s1);
  11. ds=strlen(s);
  12. ds1=strlen(s1);
  13.  
  14.  
  15. if(ds==ds1){
  16.  
  17. printf("-1");
  18. return -1;
  19.  
  20. }
  21.  
  22.  
  23. if(ds>ds1){
  24.  
  25. p=ds-ds1;
  26. for(int i=ds;i>(ds1-1);i--)
  27. novi[i-p]=s[i];
  28.  
  29.  
  30. }
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38. printf("%d\n%d\n%d\n%s",ds,ds1,p,novi);
  39.  
  40.  
  41.  
  42.  
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement