| 比赛 | EYOI与SBOI开学欢乐赛3rd | 评测结果 | AAAAAAATTT |
|---|---|---|---|
| 题目名称 | 小凯的数字 | 最终得分 | 70 |
| 用户昵称 | 惠惠 | 运行时间 | 3.000 s |
| 代码语言 | C++ | 内存使用 | 1.72 MiB |
| 提交时间 | 2022-09-05 21:21:40 | ||
#include <bits/stdc++.h>
using namespace std;
int Q;
int main()
{
freopen("xiaokai.in", "r", stdin);
freopen("xiaokai.out", "w", stdout);
cin >> Q;
for(int i = 1; i <= Q; ++i)
{
int l, r, ans = 0;
cin >> l >> r;
for(int j = l; j % 9 != 0; ++j)
{
ans = (ans + j) % 9;
}
for(int j = r; j % 9 != 0; --j)
{
ans = (ans + j) % 9;
}
cout << ans << endl;
}
return 0;
}