Advertisement
Guest User

Untitled

a guest
May 21st, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. void ZmienPary(char *s){
  6. int i,d = strlen(s);
  7. char p;
  8. for(i=0;i<d;i=i+2){
  9. p=s[i];
  10. s[i]=s[i+1];
  11. s[i+1]=p;
  12. }
  13. printf("%s",s);
  14. }
  15. int main()
  16. {
  17. char d[1000];
  18. scanf("%s",&d);
  19.  
  20. ZmienPary(d);
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement