Seudónimo Seudónimo
  • 03-11-2018
  • Computers and Technology
contestada

Can someone please help me in answering this!?!
The language is C++

Can someone please help me in answering this The language is C class=

Respuesta :

tonb
tonb tonb
  • 03-11-2018

Here is a somewhat cryptic solution that works:

#include <algorithm>

#include <cstdlib>

using namespace std;

void q(char c, int count)

{

for (int i = 0; i < count; i++) {

 putchar(c);

}

}

void p(int b1, int plusses)

{

q(' ', b1);

q('+', plusses);

}

int main()

{

for (int i = -3; i <= 3; i++)

{

 int pl = min(6, (3 - abs(i)) * 2 + 1);

 p(6-pl, pl);

 i == 0 ? p(0, 6) : p(6, 0);

 p(0, pl);

 putchar('\n');

}

getchar();

}


Answer Link

Otras preguntas

how to find the number of electrons not in a neutral atoms ?
d. State any six characteristics of present societ​
How did the war help women gain more respect and rights?
how to do this? pls don't ignore
Select the correct answer from each drop-down menu. Nadia is writing an article about a recently emerged field of veterinary science that involves caring for ab
Some begin using drugs as a means to feelings of anxiety or depression. A. successfully fix B. enhance C. try and cope with
Find the median of the data. 7, 5, 12, 8, 2, 9, 4
which water passage can we find near the tip of South America between the pacific and Atlantic oceans?
how did the French and Indian War end?
What is an inclined plane? How does it make our work easier?