Exer CPP
Exer CPP
e
version
of
Quicksor
t for
sorting
characte
rs.
void
qs(char
*items,
int left,
int right)
{
int i, j;
char x,
y;
i = left;
j = right;
**********
**********
*
**
'jumpstm
t.cpp'
Progra
m
repeated
ly
accepts
as input
a
*
characte
r and
tests it
for being
a
number
*
in the
range 1-
7 for a
day of
the
week.
**********
**********
**********
**********
**********
**********
**********
*/
#include
<iostrea
m>
using
namesp
ace std;
#include
<cstdio>
int
main()
{
int c;
cout <<
"Enter a
single-
digit
number:
";
while ((c
=
getchar()
) !=EOF)
{
if ((c ==
'\n') || (c
== '\r'))
continue
;
if ((c <
'0') || (c
> '9'))
{
cout <<
"You
must
enter a
single-
digit
number"
<< endl;
cout <<
"Enter a
number:
";
continue
;
}
switch(c)
{
case '8':
case '9':
cout <<
"Number
not in
range 1-
7 "<<
endl;
break;
if(i <= j) {
y = items[i];
items[i] = items[j];
items[j] = y;
i++; j--;
break;
case '3':
break;
case '4':
break;
case '5':
break;
case '6':
cout << "The break:\n\n";
break;
case '7':
break;
case '8':
break;
return 0;