C语言学习笔记01

#include <stdio.h>


int main()
{
    
//    hello world C
    
       printf("Hello world\n");
    
       return 0;
    
    calculation    01
    printf("13+66=$d",13+66);
    return 0;

//    variable01
    int price = 0;
    int amount = 0;
    
    printf("Please enter the price:");
    scanf("%d",&price);
    
    printf("Please enter the amount:");
    scanf("%d",&amount);
    
    int change = amount-price;
    
    printf("The change%d\n:",change);
    
    return 0;


// variable02

   int a = 0;
   int b = 0;
   
   printf("Please enter two number:");
   scanf("%d %d",&a, &b);
   printf("The number:%d %d\n",a, b);
   
   return 0;

// calculation


   int hour1,minute1;
   int hour2,minute2;
   
   scanf("%d %d",&hour1, &minute1);
   scanf("%d %d",&hour2, &minute2);
   
   int t1 = hour1*60+minute1;
   int t2 = hour2*60+minute2;
   
   int t = t1-t2;
   printf("The time difference is %dhour %dminute.",t/60, t%60);
   
   return 0;

// Float-----How tall are you in feet?
    printf("Please enter your height:");
    
    double meter;
    
    
    scanf("%lf",&meter);
    
    printf("Your height is %f foot.\n",meter*3.2808399);
    
    return 0;
    
    
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值