你们都预处理吗?我现场count过的

foo.cpp: In function 'int main()':
foo.cpp:5:10: warning: unused variable 'i' [-Wunused-variable]
int a,b,i,love=0,day=0,bye,queue[10]={6,2,5,5,4,5,6,3,7,6};
^
测试数据 #0: Accepted, time = 156 ms, mem = 564 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #2: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #3: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #4: Accepted, time = 46 ms, mem = 560 KiB, score = 10
测试数据 #5: Accepted, time = 0 ms, mem = 564 KiB, score = 10
测试数据 #6: Accepted, time = 0 ms, mem = 564 KiB, score = 10
测试数据 #7: Accepted, time = 0 ms, mem = 556 KiB, score = 10
测试数据 #8: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #9: Accepted, time = 0 ms, mem = 560 KiB, score = 10
Accepted, time = 202 ms, mem = 564 KiB, score = 100
代码
#include <iostream>
using namespace std;
int main()
{
int a,b,i,love=0,day=0,bye,queue[10]={6,2,5,5,4,5,6,3,7,6};
cin>>a>>b;
while(a!=0)
{
int k=a%10;
a/=10;
love+=queue[k];
}
while(b!=0)
{
int k=b%10;
b/=10;
day+=queue[k];
}
bye=love-day;
cout<<bye;
return 0;
}
这编译器,我没用上i他也管。。。

0 条评论

目前还没有评论...

信息

ID
1938
难度
5
分类
a 点击显示
标签
(无)
递交数
501
已通过
165
通过率
33%
被复制
3
上传者