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

What's tallest mountain in Montana
The lock-and-key mechanism refers to
Which of the following sentences contains an italicized word that's used as a predicate adjective? A. Jerry looks at the map. B. Jerry looks ill today. C. Jerry
Which type of folk music is the most prevalent among different cultures?
which is an example for karma
what were the three things japanese borrowed from korea and chine
Which one of the following statements about attitudes is correct? A. Negative attitudes can't be changed. B. Positive attitudes can help us learn qu
Choose the simple subject in the following sentence. The tallest contestant won the prize. A. contestant B. prize C. tallest D. won
In his speech Roosevelt made no mention of Germany and the war in Europe. Why?
which one of the following is a correct spelling of a plural noun. A) buffaloes B) oxes C) gooses D) knifes