又是愚人节题目qwq……

说一下题意吧:

把第1个数翻转后加第二个数

具体思路:

1.定义变量,进行输入

	int a,b;
cin>>a>>b;

2.定义一个变量c,作为存储第1个数的翻转

	int c;

3.写出翻转第一个数的代码

	while(b!=0)
{
c*=10;
c+=b%10;
b/=10;
}

c*10指把c扩大10倍,最后一位变成0

c+=b%10指将b目前的个位数赋值给c

b/=10把b除以10最后一位则为原来的十位数

4.输出a+c即可

代码如下:

#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
int c=0;
while(b!=0)
{
c*=10;
c+=b%10;
b/=10;
}
cout<<a+c; return 0;
}

亲测可以ac

题解 CF171A 【Mysterious numbers - 1】的更多相关文章

  1. 题解-Roman and Numbers

    题解-Roman and Numbers 前置知识: 数位 \(\texttt{dp}\) </> \(\color{#9933cc}{\texttt{Roman and Numbers} ...

  2. [LeetCode 题解]: Add Two Numbers

    You are given two linked lists representing two non-negative numbers. The digits are stored in rever ...

  3. leetcode 题解 Add Two Numbers(两个单链表求和)

    题目: You are given two linked lists representing two non-negative numbers. The digits are stored in r ...

  4. LeetCode题解——Add Two Numbers

    题目: 两个数字求和,数字用链表表示,每一个结点代表一位.链表顺序与数字顺序相反,即表头存放数字的最低位. 解法: 分别遍历两个链表的每个结点,对两个结点求和即可.要维护一个变量保存每次相加之后的进位 ...

  5. PAT甲级题解-1100. Mars Numbers (20)-字符串处理

    没什么好说的,注意字符串的处理,以及当数字是13的倍数时,只需高位叫法的单词.比如26,是“hel”,而不是“hel tret”. 代码: #include <iostream> #inc ...

  6. PAT甲题题解-1120. Friend Numbers (20)-水题

    博主欢迎转载,但请给出本文链接,我尊重你,你尊重我,谢谢~http://www.cnblogs.com/chenxiwenruo/p/6789775.html特别不喜欢那些随便转载别人的原创文章又不给 ...

  7. 题解 CF1428G Lucky Numbers (Easy Version and Hard Version)

    这题没有压行就成 \(\texttt{Hard Version}\) 最短代码解了( 要知道这题那么 \(sb\) 就不啃 \(D\) 和 \(E\) 了. \(\texttt{Solution}\) ...

  8. CF55D Beautiful numbers 题解

    题目 Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer n ...

  9. 【题解】【链表】【Leetcode】Add Two Numbers

    You are given two linked lists representing two non-negative numbers. The digits are stored in rever ...

随机推荐

  1. proptypes介绍

    开始 prop-types的主要作用:对props中数据类型进行检测及限制 引用方法:import PropTypes from 'prop-types' 用法: // 基本用法 用来检测数据类型 c ...

  2. Erlang/Elixir精选-第6期(20200113)

    精选文章 Implementing languages on the Erlang VM. -Robert Virding. 因为视频没有显示PPT,PPT可以在点击这里下载. leex - lexi ...

  3. JS DOM用不同方法获取节点及对节点插入、复制和移除

    操作节点的方法 appendChild() insertBefore() replaceChild() cloneNode() normalize() splitText() sppendChild( ...

  4. 【终端命令】组管理 和 Ubuntu中的"sudo"命令

    一.超级用户root 1.超级用户和标准用户 Linux系统中的root账户通常 用于系统的维护和管理,对操作系统的 所有资源 具有所有访问权限. 在大多数版本的Linux系统中,都 不推荐 直接使用 ...

  5. Spring mvc拦截器防御CSRF攻击

    CSRF(具体参考百度百科) CSRF(Cross-site request forgery跨站请求伪造,也被称为“One Click Attack”或者Session Riding,通常缩写为CSR ...

  6. Java邮件发送工具类

    个人博客 地址:https://www.wenhaofan.com/article/20190507104851 引入Pom依赖 依赖于apchae email包,maven项目可直接加入以下依赖,普 ...

  7. Ubuntu中FTP安装配置及基本概念(原创)

    注:本文出自博主 Chloneda:个人博客 | 博客园 | Github | Gitee | 知乎 本文源链接:https://www.cnblogs.com/chloneda/p/ftp-inst ...

  8. 使用INF创建CSR文件

    公司要为一个英国的客户提供由HTTP升级到HTTPS的服务,于是接触到了申请SSL证书这方面的内容. 一.总的来说,申请证书需要两步,一是创建CSR文件,二是在证书提供商购买证书并将CSR文件发给证书 ...

  9. oracle基础知识点

    一.count(*).count(1).count(字段名)的区别select count(*) from t_md_inst --153797 --包含字段为null 的记录select count ...

  10. CodeForces - 1109A

    #include<cstdio> #include<map> #include<iostream> #include<algorithm> using ...