第五章
#include<stdio.h>
#define ADJUST 7.31
int main(void)
{
const double SCALE = 0.333;
double shoe, foot;
shoe = 9.0;
foot = SCALE * shoe + ADJUST;
printf("Shoe size (men's') foot length\n");
printf("%10.1f %15.2f inches\n",shoe,foot);
return 0;
}
#include<stdio.h>
#define ADJUST 7.31
int main(void)
{
const double SCALE = 0.333;
double shoe, foot;
printf("Shoe size (men's) foot length\n");
shoe = 3.0;
while (shoe < 18.5)
{
foot = SCALE * shoe * ADJUST;
printf("%10.1f %15.2f inches\n",shoe, foot);
shoe = shoe + 1.0;
}
printf("If the shoe fits, wear it.\n");
return 0;
}
#include<stdio.h>
int main(void)
{
int jane, tarzan, cheeta;
cheeta = tarzan = jane = 68;
printf(" cheeta tarzan jane\n");
printf("First round score %4d %8d %8d\n",cheeta, tarzan, jane);
return 0;
}
#include<stdio.h>
int main(void)
{
int num = 1;
while (num < 21)
{
printf("%4d %6d\n",num, num * num);
num = num + 1;
}
return 0;
}
#include<stdio.h>
#define SQUARES 64
int main(void)
{