Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<fstream>
- #include <cstring>
- using namespace std;
- char s[11];
- int i,j,k,t;
- int main()
- {
- ofstream g("out.txt");
- cin.get(s,11);
- cout<<s;
- cout<<endl;
- for(k=1;k<=strlen(s);k++)
- {
- for(i=0;i<=k-1;i++)
- cout<<s[i];
- cout<<" ";
- }
- cout<<endl;
- for(t=strlen(s)-1;t>=0;t++)
- {
- for(i=t;i>=0;i--)
- cout<<s[i];
- cout<<" ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement