fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. for(int i=0;i<5;i++){
  6. int p=1,k=(5-i);
  7. for(int j=0;j<10;j++){
  8. if(j<(5-i)){
  9. cout<<p;
  10.  
  11. p++;
  12. }else if(j>=(5+i)){
  13. cout<<k;
  14. k--;
  15. }
  16. else{
  17. cout<<"*";
  18. }
  19. }
  20. cout<<endl;
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 4456KB
stdin
Standard input is empty
stdout
1234554321
1234**4321
123****321
12******21
1********1