fork download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. const int MAX_SIZE = 100;
  6.  
  7. void readAllSufix(char a[]) {
  8. int n = strlen(a), dif = 1;
  9. for (int i = 0; i < n; ++i) {
  10. for (int j = n - dif; j < n; ++j) {
  11. cout << a[j];
  12. }
  13. cout << "\n";
  14. ++dif;
  15. }
  16. }
  17. int main() {
  18. char row[MAX_SIZE];
  19. cin.getline(row, MAX_SIZE);
  20. readAllSufix(row);
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5280KB
stdin
maria
stdout
a
ia
ria
aria
maria