又是愚人节题目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. Linux 网络客户端工具

    ping命令 发送ICMP协议的echo request给目标主机 常用选项: 从指定的本机接口发送ICMP:-I INTERFACE 本机有多个接口(网卡),可以选择从哪个接口发:-I(大写i) 接 ...

  2. kthrotlds(WatchDogs变种)查杀方法

    病毒现象 服务器出现卡顿.CPU飙升 以下为WatchDogs的判断方式及其命令:存在恶意进程watchdogs: ps -ef | grep watchdogs存在恶意进程ksoftirqds: p ...

  3. C# convert json to datatable,convert list to datatable

    static DataTable ConvertJsonToTable(string jsonValue) { DataTable dt = (DataTable)JsonConvert.Deseri ...

  4. Mysql连接字符,字段函数concat()

    Mysql连接字符,字段函数concat() 可将多个字符串或字段连接,多个参数以逗号隔开 select concat('现在是:',new_date) from work

  5. ArcGIS Server 地图服务,查询出错 Error performing query operation

    Error: Error performing query operation Error Message Querying a layer from a Map Service that retur ...

  6. 怎么解决Chrome浏览器“Failed to load resource: net::ERR_INSECURE_RESPONSE”错误?

    用科学方法安装的arcgisServer,需要修改系统时间,但是修改了系统时间,可能会出各种问题, office 不能正确验证,chrome 不能正常使用,访问网页, 如果直接输入本地地址进行访问的话 ...

  7. 关于跨域cookie,在代码无问题下,浏览器set-cookie显示有内容,但浏览器没写入cookie(刷新没有cookie)

    在排除了代码的问题后,如 Domain 不一致,过期时间是基于当前时间增加过期时效的. 在排查返回请求时发现是过期时间的问题,设置的过期时间(Expire)小于请求的时间(Date)时,浏览器就会写不 ...

  8. 硬核干货 | C++后台开发学习路线

    2020秋招提前批 C/C++相关开发 拿到腾讯.华为等offer 学习路线及时间安排 推荐时间为4个月,包括四部分:语言,计算机基础知识,项目基础知识,项目实践. 语言 推荐学习1个月 学习方针:视 ...

  9. WinForm WebBrowser 设置IE版本

    public enum IeVersion { IE7 = , IE8 = , IE9 = , IE10 = , IE11 = }; /// <summary> /// 修改注册表信息来兼 ...

  10. Dynamics CRM 365中结合注释和WebApi实现图片上传

    首先需要在实体上使用注释,然后在窗体上引用WebResource. WebResource的代码: <!DOCTYPE html> <html> <head> &l ...