C语言-找错(找的累啊,就是找不到错在哪儿)

来源:百度知道 编辑:UC知道 时间:2024/06/05 01:42:58
/*Calculating the height of a tree */
#include<stdio.h>

void main()

{
long shorty=0L; /*shorty's height in inches */
long lofty=0L; /*lofty'height in inches */
long feet=0L; /*A whole number of feet */
long inches=0L; /* A whole number of inches */
long shorty_to_lofty=0L; /* distance form shorty to lofty in iches */
long lofty_to_tree=0; /* distance form lofty to tree */
long tree_height=0; /* height of the tree in inches */
const long inches_per_foot=12L;

/* Get lofty's height */

prinft("Enter lofty's height to the top of his/her head,in whole feet: ");
scanf("%d",&feet);
printf("

有3个 printf写成了 prinft

/*Calculating the height of a tree */
#include<stdio.h>

void main()

{
long shorty=0L; /*shorty's height in inches */
long lofty=0L; /*lofty'height in inches */
long feet=0L; /*A whole number of feet */
long inches=0L; /* A whole number of inches */
long shorty_to_lofty=0L; /* distance form shorty to lofty in iches */
long lofty_to_tree=0; /* distance form lofty to tree */
long tree_height=0; /* height of the tree in inches */
const long inches_per_foot=12L;

/* Get lofty's height */

printf("Enter lofty's height to the top of his/her head,in whole feet: ");
scanf("%d",&feet);
printf(" ........... and then inches: ");
scanf("%d",&inches);
lofty=feet*inches_per_foot+inches;

/*Get shorty's height up to his/her eyes*/
printf("Ent