#include stdio.h#define ADJUST 7.31// one kind of symbolic constantint main(void){const double SCALE = 0.333;// another kind of symbolic constant
编程学习网为您整理以下代码实例,主要实现:将鞋码转换为英寸,希望可以帮到各位朋友。
#include <stdio.h>
#define ADJUST 7.31 // one kind of symbolic constant
int main(voID){
const double SCALE = 0.333; // another kind of symbolic constant
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;
}