记录编号 492443 评测结果 AAAAAA
题目名称 加法问题 最终得分 100
用户昵称 Gravatar不错封ID几十块 是否通过 通过
代码语言 C++ 运行时间 0.027 s
提交时间 2018-03-26 00:41:29 内存使用 0.24 MiB
显示代码纯文本
  1. //Quick read
  2.  
  3. #include <cstdio>
  4. #include <cctype>
  5.  
  6. char tc;
  7. int nextInt()
  8. {
  9. int ans = 0;
  10. int opt = 1;
  11. while (tc != EOF && (!isdigit(tc) && tc != '-')) tc = getchar();
  12. if (tc == '-')
  13. {
  14. opt = -1;
  15. tc = getchar();
  16. }
  17. while (tc != EOF && isdigit(tc))
  18. {
  19. ans = ans * 10 + tc - '0';
  20. tc = getchar();
  21. }
  22. return (ans * opt);
  23. }
  24.  
  25. double nextDouble()
  26. {
  27. double ans = 0;
  28. double b = 0.1;
  29. double opt = 1;
  30. while (tc != EOF && (!isdigit(tc) && tc != '-')) tc = getchar();
  31. if (tc == '-')
  32. {
  33. opt = -1;
  34. tc = getchar();
  35. }
  36. while (tc != EOF && isdigit(tc))
  37. {
  38. ans = ans * 10 + tc - '0';
  39. tc = getchar();
  40. }
  41. if (tc == '.')
  42. {
  43. tc = getchar();
  44. while (tc != EOF && isdigit(tc))
  45. {
  46. ans += (tc - '0') * b;
  47. b /= 10;
  48. tc = getchar();
  49. }
  50. }
  51. return ans * opt;
  52. }
  53.  
  54. int main()
  55. {
  56. freopen("aplusb.in", "r", stdin);
  57. freopen("aplusb.out", "w", stdout);
  58. tc = getchar();
  59. double a = nextDouble(), b = nextDouble();
  60. printf("%d\n", int(a + b + 1e-7));
  61. return 0;
  62. }