endlendl grendel
It prints a diagonal line of the specified length. [The problem said to write a brief, simple English sentence; we did not want a paragraph-length blow-by-blow account of what the program was doing.]
#include <iostream>
using namespace std;
int main()
{
int len;
cout << "Enter a number: ";
cin >> len;
for (int i = 0; i < len; i++)
{
int j = i+1;
while (j < len)
{
cout << ' ';
j++;
}
cout << "#" << endl;
}
}
switch (month)
{
case 6:
cout << "summer solstice";
break;
case 12:
cout << "winter solstice";
break;
case 3:
case 9:
cout << "equinox";
break;
default:
cout << "nothing special";
}