算数表达式的练习

c中各种运算符的实践

整形运算:

#include<stdio.h>
int main()
{
    printf("%d",1+2);
printf("%d",1*2);
printf("%d",1/2);
printf("%d",1-2); return 0; }

浮点数运算:

#include<stdio.h>
int main()
{

    printf("%f",5.0/8.0);

  //  printf("%f",5/8.0);

    return 0;
    }

带根式的运算:

#include<stdio.h>
#include<math.h>//计算算术平方根的函数在math.h中
int main()
{
    printf("%.8f",1+2*sqrt(3)/(5-0.1));//sqrt(x)计算x的算数平方根
    return 0;
    }

 把背景图传这好了

posted @ 2014-08-01 00:55  z52527  阅读(109)  评论(0编辑  收藏  举报