`
xrtkong
  • 浏览: 15509 次
  • 性别: Icon_minigender_1
  • 来自: 济南
最近访客 更多访客>>
社区版块
存档分类
最新评论

C语言入门经典

阅读更多

/* programe  which rember user to input width and length in inches,then output the square of the room in square yard */
#include<stdio.h>
#include<math.h>
int main(){
    long length = 0L ;
    long width = 0L ;
    long sqreinches = 0L ;
    float sqre = 0.0f;
    printf(" Please input the room's width:");
    scanf("%ld",&width);

    printf(" Please input the room's height:");
    scanf("%ld",&length);

     sqreinches = length * width ;
     sqre =  (float)sqreinches / 9 ;
     printf("the sqre is %.2f",sqre);
     return 0 ;
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics