P5706 再分肥宅水

题意:

现在有 t 毫升肥宅快乐水,要均分给 n 名同学。每名同学需要 2 个杯子。现在想知道每名同学可以获得多少毫升饮料(严格精确到小数点后 3 位),以及一共需要多少个杯子。输入一个实数 t 和一个整数 n,使用空格隔开。输出两个数字表示答案,使用换行隔开。

 

0<t<10000 ,1<n<100

 

#include<stdio.h>
#include<stdlib.h>
int main()
{
    double t;
    int n=0;
    double a=0;
    int b=0;
    scanf("%lf%d",&t,&n);    
    printf("%.3lf\n%d",(t/(double)(n)),(n*2));
    return 0;    
 } 

 

posted @ 2020-03-31 12:09  今天喝奶茶了吗  阅读(650)  评论(1)    收藏  举报