#include <tscope5.h>
#include <stdio.h>
int main()
{
double w;
int test;
char subj[50];
subj[0] = '\0';
do {
test =
ts5_scanf(20.0 + w, 20.0,
"%s", subj);
} while (test != 1);
char gender = 0;
do {
test =
ts5_scanf(20.0 + w, 20.0,
"%c", &gender);
} while (test != 1 || (gender != 'm' && gender != 'f'));
char hand = 0;
do {
test =
ts5_scanf(20.0 + w, 20.0,
"%c", &hand);
} while (test != 1 || (hand != 'l' && hand != 'r'));
int age = 0;
do {
test =
ts5_scanf(20.0 + w, 20.0,
"%d", &age);
} while (test != 1 || (age<0 || age>120));
char tmp1[20], tmp2[20];
if (gender == 'm') {
sprintf(tmp1, "male");
}
else {
sprintf(tmp1, "female");
}
if (hand == 'l') {
sprintf(tmp2, "left handed");
}
else {
sprintf(tmp2, "right handed");
}
ts5_printf(20.0, 20.0,
"%s is %d years old,", subj, age);
return 0;
}