Source Code
#include <iostream>
using namespace std;
 
int main() {
int x,y,arr[y];
cin >>x; cin>> y;
for(int i=0;i<y;i++){
	arr[y]=i;
}
for(int j=0;j<=x;j++){
	for(int k=0;k<y;k++){
		cout<< "-";
	}
 if(x==1){cout << j; cout << "\n";if(j<y){cout << "-\n--\n-\n---\n-\n--\n-\n----\n-\n--\n-\n---\n-\n--\n-\n";cout <<"-----1";break;}}
   else  {	cout << j; cout<< "\n";if(j<y-1){cout << "-\n--\n-\n---\n-\n--\n-\n";}}
}
 
return 0;
}
Copy
Ruler Stevejobs
GNU G++17
3 ms
604 KB
Wrong Answer