题目地址:Luogu P5706
同样是顺序结构题单的一题,话说我已经刷了这题单一半题了啊......
基本的乘除问题,代码如下:
#include <stdlib.h>
#include <stdio.h>
int main()
{
float total;
int quantity;
scanf("%f", &total);
scanf("%d", &quantity);
// compute cola of every student
double average = total / (double)quantity;
printf("%.3f\n%d", average, quantity * 2);
return 0;
}
C++ O2编译环境下,最长耗时3ms,最大内存708.00KB,可放心食用。