学习笔记

/*write a programe,rember user to input a distanc in inches,the output the distance in yard foot,inches*/
/*one yard = 3 foot , one foot = 12 inches*/
#include<stdio.h>
int main(){
    long inches = 0L ;
    long foot = 0L ;
    long yard = 0L ;
   
    printf(" Input the Inches : ");
   
    scanf("%ld",&inches);
    foot = inches / 12 ;
    yard = foot / 3 ;

    printf("\n 输入的英寸数为:%ld 码,%ld 英尺,%ld 英寸" , yard , foot , inches);

    return 0 ;

}

你可能感兴趣的:(学习笔记)