我校OJ迷路的小路痴为什么老是超时??(1043)
还有对2016取模??(1053)明明对了,还是说我错
(1053)
#include <iostream>
#include <cstring>
using
namespace
std;
char
a[305];
int
main()
{
while
(cin >> a)
{
int
k =
strlen
(a);
long
sum = 0;
for
(
int
i = 0; i < k; i++)
{
sum += a[i]-48;
sum = sum%2016;
sum = sum*10;
}
cout << sum/10 << endl;
}
return
0;
}
时间: 2024-10-12 03:00:54