a 加 b 的反序表示的数;

# include <cstdio>
# include <cstring>

int a, b;
char s[11];

void init(void)
{
    scanf("%d%s", &a, s);
}

void solve(void)
{
    b = 0;
    for (int i = strlen(s)-1; i >= 0; --i)
    {
        b *= 10;
        b += s[i]-'0';
    }
    printf("%d\n", a+b);
}

int main()
{
    init();
    solve();

    return 0;
}

相关文章:

  • 2021-10-27
  • 2022-02-03
  • 2021-09-05
  • 2021-12-11
  • 2021-04-30
  • 2021-06-08
  • 2022-12-23
  • 2021-11-06
猜你喜欢
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案