T1000
1 #include <stdio.h> 2 int main() 3 { 4 int a, b; 5 while (scanf("%d %d", &a, &b) != EOF) 6 printf("%d ", a + b); 7 return 0; 8 }
T1001
1 #include <stdio.h> 2 #ifdef AUTHOR 3 Code By Hatsuakira Tenan 4 #endif 5 int f(int n) 6 { 7 int js = 0; 8 for (; n > 0; --n) 9 js += n; 10 return js; 11 } 12 int main() 13 { 14 int n; 15 while (scanf("%d", &n) != EOF) 16 printf("%d ", f(n)); 17 return 0; 18 }
T1002
1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <algorithm> 5 #define MAXLENGTH 1002 6 #define MAXCARRY 10000 7 #ifdef AUTHOR 8 Code By Hatsuakira Tenan 9 #endif 10 struct largeint 11 { 12 int num[MAXLENGTH], len; 13 largeint() 14 { 15 len = 1; 16 memset(num, 0, sizeof(num)); 17 } 18 }; 19 void scanf_override(largeint &input) 20 { 21 int tmplen; 22 char tmp[MAXLENGTH]; 23 scanf("%s", tmp); 24 std::reverse(tmp, tmp + (tmplen = strlen(tmp))); 25 input.len = tmplen / 4 + (tmplen % 4 > 0); 26 for (int i = 0, j = 0; i < tmplen; ++i, ++j) 27 { 28 input.num[j] = tmp[i] - '0'; 29 if (tmp[++i] == '