Advertisement
catalyn

prob1 afisarea prefixelor

Mar 6th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include<cstring>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,i;
  8. char s[256];
  9. cin.getline(s,256);
  10. n=strlen(s);
  11. int m=n,j;
  12.  
  13. for(i=1;i<=n;i++)
  14. {
  15. for(j=0;j<=m-1;j++)
  16. cout<<s[j];
  17. cout<<'\n';
  18. m--;
  19. }
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement