Advertisement
Guest User

asdas

a guest
Oct 14th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include<fstream>
  3. #include <cstring>
  4.  
  5. using namespace std;
  6. char s[11];
  7. int i,j,k,t;
  8. int main()
  9. {
  10. ofstream g("out.txt");
  11. cin.get(s,11);
  12. cout<<s;
  13. cout<<endl;
  14. for(k=1;k<=strlen(s);k++)
  15. {
  16. for(i=0;i<=k-1;i++)
  17. cout<<s[i];
  18. cout<<" ";
  19. }
  20. cout<<endl;
  21. for(t=strlen(s)-1;t>=0;t++)
  22. {
  23. for(i=t;i>=0;i--)
  24. cout<<s[i];
  25. cout<<" ";
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement