注意此简单程序的printf函数

#include <stdio.h>
#include <stdlib.h>

int main()
{
    double a,b;
    int c;
    scanf("%lf%lf%d",&a,&b,&c);
    printf("%.*f",c,a/b);// 输出小数点后c位
    return 0;
}

 

posted @ 2014-02-12 16:11  码农@163  阅读(160)  评论(0编辑  收藏  举报