- 告别情人节
- 2016-08-27 20:22:40 @
怎么说呢?这样的题目比较少见……我也是看到有人骂这题才来看的……然后交了如下一份程序:
c++
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<a-b;
return 0;
}
怎么说好呢?你不难发现此题样例4就错了,然后注意a和b的范围,没说是>=0的。
总的说呢……
出题者ZZ
1 条评论
-
lrj124 LV 10 @ 2016-08-27 23:06:46
###****应该输出a需要的火柴棍数-b需要的火柴棍数****
```c++
评测结果
编译成功测试数据 #0: Accepted, time = 0 ms, mem = 896 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 900 KiB, score = 10
测试数据 #2: Accepted, time = 0 ms, mem = 896 KiB, score = 10
测试数据 #3: Accepted, time = 0 ms, mem = 896 KiB, score = 10
测试数据 #4: Accepted, time = 0 ms, mem = 892 KiB, score = 10
测试数据 #5: Accepted, time = 0 ms, mem = 896 KiB, score = 10
测试数据 #6: Accepted, time = 0 ms, mem = 896 KiB, score = 10
测试数据 #7: Accepted, time = 0 ms, mem = 900 KiB, score = 10
测试数据 #8: Accepted, time = 0 ms, mem = 896 KiB, score = 10
测试数据 #9: Accepted, time = 0 ms, mem = 896 KiB, score = 10
Accepted, time = 0 ms, mem = 900 KiB, score = 100
代码
#include <cstdio>
int main() {
int a,b,cnt[1001] = {6,2,5,5,4,5,6,3,7,6};
for (int i = 10;i <= 1000;i++) {
int tmp = i;
while (tmp) {
cnt[i] += cnt[tmp%10];
tmp /= 10;
}
}
scanf("%d%d",&a,&b);
printf("%d",cnt[a]-cnt[b]);
return 0;
}
```
- 1