ITeye博客

学习笔记

xrtkong · 2011-10-10 22:49 · 技术成长之路 · 编程语言 · Markdown

/*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 ;

}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。