solution.md 1.5 KB
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
# 存了多少零钱

<p style="margin-left:.0001pt; margin-right:0">小林和小树兄弟俩相约存零钱。眼看到年底了&#xff0c;兄弟俩决定算算一共存了多少钱&#xff0c;请帮他们算出来。</p><p style="margin-left:.0001pt; margin-right:0">输入&#xff1a;</p><p style="margin-left:.0001pt; margin-right:0">两行&#xff0c;第一行三个整数分别对应元、角、分&#xff0c;表示小林存的零钱数&#xff1b;</p><p style="margin-left:.0001pt; margin-right:0">第二行三个整数分别对应元、角、分&#xff0c;表示小树存的零钱数。</p><p style="margin-left:.0001pt; margin-right:0">输出&#xff1a;</p><p style="margin-left:.0001pt; margin-right:0">两人存的钱数&#xff08;单位&#xff1a;&#xff0c;保留2位小数)</p><p style="margin-left:.0001pt; margin-right:0">样例输入&#xff1a;</p><p style="margin-left:.0001pt; margin-right:0">30 5 5</p><p style="margin-left:.0001pt; margin-right:0">45 7 4</p><p style="margin-left:.0001pt; margin-right:0">样例输出&#xff1a;</p><p style="margin-left:.0001pt; margin-right:0">76.29</p>

## template

```cpp
#include <stdio.h>
int main()
{
	int y1,j1,f1,y2,j2,f2;
	int y,j,f;
	int shiftj = 0;
	int shifty = 0;
	float ss ;
	scanf("%d %d %d",&y1,&j1,&f1);
	scanf("%d %d %d",&y2,&j2,&f2);
	f = f1 + f2;
	if(f>=10)
	{
		f = f-10;
		shiftj = 1;
	}
	j = j1 + j2 + shiftj;
	if(j >= 10)
	{
		j = j - 10;
		shifty = 1;
	}
	y = y1 + y2 + shifty;
	ss = y + j/10.0 + f/100.0;
	printf("%.2f\n",ss);
	return 0;
}
```

## 答案

```cpp

```

## 选项

### A

```cpp

```

### B

```cpp

```

### C

```cpp

```