Source Code
#include <iostream>
using namespace std;
 
int main() {
int l,p;
  cin >> l;
  if(l<1){cin >> l;}
  cin >> p;
  if(p>10){cin >> p;}
  if(l==1){for(int k = 0 ; k<= l ; k++){
     if(k!=0){
      cout << "-" << endl ;
        cout << "--" << endl ;
        cout << "-" << endl ;
        cout << "---" << endl ;
     cout << "-" << endl ;
        cout << "--" << endl ;
        cout << "-" << endl ;
            cout << "----" << endl ;
     cout << "-" << endl ;
        cout << "--" << endl ;
        cout << "-" << endl ;
        cout << "---" << endl ;
     cout << "-" << endl ;
        cout << "--" << endl ;
        cout << "-" << endl ;}
    for(int i = 1 ; i<= p ; i++){
  cout << "-" ;
}cout << k << endl;}}

  
 else {for(int j = 0 ; j<= l ; j++){
   if(j!=0){cout << "-" << endl ;
        cout << "--" << endl ;
        cout << "-" << endl ;
        cout << "---" << endl ;
     cout << "-" << endl ;
        cout << "--" << endl ;
        cout << "-" << endl ;
 }
  for(int i = 1 ; i<= p ; i++){
  cout << "-" ;
}
   cout << j << endl;}}

 
return 0;
}
Copy
Ruler DinaQ
GNU G++17
3 ms
788 KB
Wrong Answer