#include
using namespace std;
main() {
int squareWidth,limit,tempWidth = 0,i;
cout<< "Enter Widht: ";
cin>> squareWidth;
limit = (squareWidth-1)*4;
limit++;
for(int width=1; width<=squareWidth; width++) {
if(width <= 1)
for(i=1; i<=squareWidth; i++) {
tempWidth++;
cout<< tempWidth<<"\t";
}
else if(width cout<< endl;
for(i=1; i<=squareWidth; i++) {
if(i==1 || i==squareWidth)
if(i == 1) {
limit--;
cout< }
if(i == squareWidth) {
tempWidth++;
cout< }
else
cout<<"\t";
}
} else {
cout<< endl;
for(i=limit-1; i>tempWidth; i--) {
cout<< i<<"\t";
}
}
}
}
using namespace std;
main() {
int squareWidth,limit,tempWidth = 0,i;
cout<< "Enter Widht: ";
cin>> squareWidth;
limit = (squareWidth-1)*4;
limit++;
for(int width=1; width<=squareWidth; width++) {
if(width <= 1)
for(i=1; i<=squareWidth; i++) {
tempWidth++;
cout<< tempWidth<<"\t";
}
else if(width
for(i=1; i<=squareWidth; i++) {
if(i==1 || i==squareWidth)
if(i == 1) {
limit--;
cout<
if(i == squareWidth) {
tempWidth++;
cout<
else
cout<<"\t";
}
} else {
cout<< endl;
for(i=limit-1; i>tempWidth; i--) {
cout<< i<<"\t";
}
}
}
}
No comments:
Post a Comment