Odpowiedź:
#include <iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
string output="";
for (int i=0;i<n;i++)
{
output += "H";
for (int j=0;j<m-2;j++)
if (i!=n/2-1)
output+=" ";
else
output+="H";
}
output+="H\n";
cout<<output;
return 0;
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
Odpowiedź:
#include <iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
string output="";
for (int i=0;i<n;i++)
{
output += "H";
for (int j=0;j<m-2;j++)
{
if (i!=n/2-1)
output+=" ";
else
output+="H";
}
output+="H\n";
}
cout<<output;
return 0;
}