题目描述
本题为填空题,只需要算出结果后,在代码中使用输出语句将所填结果输出即可。
少年宫新近邮购了小机器人配件,共有3类。
A 类含有:8 个轮子,1 个传感器;
B 类含有: 6 个轮子,3 个传感器;
C 类含有:4 个轮子,4 个传感器。
他们一共订购了 100 套机器人,收到了轮子 600 个,传感器 280 个。
根据这些信息请你计算:B类型机器人订购了多少个?
运行限制
- 最大运行时间:1s
- 最大运行内存: 128M
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<math.h>
#include<map>
#include<vector>
const double m=1e+5;
using namespace std;
int main() {
int a=0,b=0,c=0;
for(a=0;a<=100;a++)
{
for(b=0;b<=100;b++)
{
c=100-a-b;
int h=8*a,i=6*b,j=4*c,k=a,q=3*b,w=4*c;
int sum1=h+i+j,sum2=k+q+w;
if(sum1==600&&sum2==280)
printf("%d\n",b);
}
}
return 0;
}