标签:
input | output |
---|---|
123456123456 |
1 |
1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #include <iostream> 5 using namespace std; 6 const int N = 110; 7 int Arr[N], n; 8 char Str[N]; 9 #define For(i, s, t) for(int i = (s); i <= (t); i++) 10 11 int main() 12 { 13 scanf("%s", Str + 1); 14 n = strlen(Str + 1); 15 For(i, 1, n) Arr[i] = Str[i] - ‘0‘; 16 int Last = 0; 17 For(i, 1, n) 18 { 19 Last = Last * 10 + Arr[i]; 20 Last %= 7; 21 } 22 cout << Last << endl; 23 return 0; 24 }
ural 1243. Divorce of the Seven Dwarfs
标签:
原文地址:http://www.cnblogs.com/StupidBoy/p/4964513.html