int t, l, c;
char p;
cin >> t;
while (t != 0) {
cin >> l >> c;
if (l == c) {
if (l != 2 && c != 2) {
cout<<endl;
for (int i = 0; i < l; i++) {
p = '*';
cout << p;
}
cout << endl;
for (int j = 2; j < l; j++) {
p = '*';
cout << p;
for (int i = 2; i < c; i++) {
p = '.';
cout << p;
#include
using namespace std;
int main() {
// your code goes here
int t, l, c;
char p;
cin >> t;
while (t != 0) {
cin >> l >> c;
if (l == c) {
for (int i = 0; i < l; i++) {
p = '*';
cout << p;
}
cout << endl;
for (int j = 2; j < l; j++) {
p = '*';
cout << p;
for (int i = 2; i < c; i++) {
p = '.';
cout << p;
}
p = '*';
cout << p;
cout << endl;
}
for (int i = 0; i < l; ) {
p = '*';
cout << p;
++i;
}
cout<<endl;
}
if(l!=c||l<c||c<l){
for (int i = 0; i < l; ) {
for (int j = 0; j < c;) {
p = '*';
cout << p;
j++;
}
++i;
cout<<endl;
}
}
if (l == 2 && c == 2) {
for (int i = 0; i < l;) {
for (int j = 0; j < c; j++) {
p = '*';
cout << p;
}
++i;
cout << endl;
}
}
--t;
cout<<endl;
}
return 0;
}
this is my code in c++, I am getting this as wrong ans but it is working in my pc .Kindly help.