PAT A1001 A+B Format(20)

Keras深度学习实战(32)——基于LSTM预测股价 股价预测是时间序列预测中最具挑战性的问题之一,研究股价预测问题具有重要的理论意义和应用价值。针对循环神经网络在股价预测中存在的长期依赖等缺点,本文引入了长短时记忆神经网络以提高股价预测的效果。同时,我们把有关公司的新闻标题的文本数据作为模型的输入变量时,发现预测效果更好,因此我们可以把有关公司的新闻标题的文本数据作为一个有效的输入变量。最后,通过利用 Keras 实现了以上两个股价预测模型,并进行了性能分析和对比。 阅读详情

题意

  • 把两个数相加,三位一逗号格式(从最低位开始)。

注意

  1. 负号。
  2. 第一个逗号若在首位,则不输出。
  3. 溢出(测试用例无体现)

单词

  1. commas 逗号

代码

#include<iostream>
#include<string>
using namespace std;
void cal(int a, int b)
{
	int c = a + b;
	int k = 0;
	int cc = c;
	while (cc)
	{
		cc = cc / 10;
		k++;
	}

	string str;
	str = to_string(c);
	//cout << str;

	char st[100] = {0};
	if(k>3)
	{
		if (c > 0)
		{
			int i = 0;
			int d = 0;
			while (i <= k - 1)
			{
				if (((k - i) % 3 == 0) && i != 0)
				{
					st[i] = ',';
					cout << st[i];
					d++;
				}
				st[i + d] = str[i];
				cout << st[i + d];
				i++;

			}
		}
		else
		{
			st[0] = '-';
			cout << st[0];

			int i = 1;
			int d = 0;
			while (i <= k)
			{
				if (((k + 1 - i) % 3 == 0) && i != 1)
				{
					st[i] = ',';
					cout << st[i];
					d++;
				}
				st[i + d] = str[i];
				cout << st[i + d];
				i++;
			}
		}
		cout<<endl;
	}
	else
	{
		cout<<c<<endl;
	}

}
int main()
{
	int a, b;
	while(cin >> a >> b)
		cal(a, b);
		
	return 0;
}

上面这个写得太搓了,,,再来一个吧

#include<iostream>
#include<string>
using namespace std;

void cal(int a, int b)
{
	int c = a + b;
	int cc, k;
	for (cc = c, k = 0; cc; k++)
		cc /= 10;                  // 5/10 = 0 统计位数

	if (!c) k = 1;                 // 处理0
	string str = to_string(c);

	if (c < 0)                       // 20190225改
	{
		cout << "-";
		str = str.substr(1, str.size() - 1);
	}
	for (int i = 0; i < k; i++)
	{
		if (((k - i) % 3 == 0) && i != 0)
			cout << ',';
		cout << str[i];
	}
	cout << endl;
}

int main()
{
	int a, b;
	while (cin >> a >> b)
		cal(a, b);

	return 0;
}
YOLOv11涨点改进 | 全网独家下采样改进、细节涨点篇 | TGRS 2025 | 引入PWD参数化小波下采样模块,减少下采样过程中小目标的关键细节丢失,即插即用,助力高效涨点发论文 本文提出了一种改进YOLOv11小目标检测性能的参数化小波下采样(PWD)模块。PWD通过小波变换保留目标细节信息,增强频率域特征表达,有效解决了传统下采样导致的小目标信息丢失问题。该模块采用双分支设计,结合自适应频率选择和空间补偿机制,在红外图像和低光场景中表现出更强的抗干扰能力。实验表明,PWD能显著提升YOLOv11对弱纹理和低对比度目标的检测精度,同时保持计算效率。文章详细介绍了PWD的结构原理、实现代码及在YOLOv11中的集成方法,为小目标检测提供了有效的改进方案。 阅读详情

相关推荐

TeXstudio完整安装配置教程(2025最新版)

至此,你已经完成了TeXstudio的完整安装和配置!现在你可以:✅ 使用TeXstudio编写LaTeX文档✅ 正确编译中英文混排的文档✅ 掌握基本的编辑和配置技巧LaTeX的学习曲线较陡,但一旦掌握,你会发现它在学术写作中的强大之处。建议从简单的文档开始练习,逐步掌握更高级的功能。祝你LaTeX写作顺利!如果有任何问题,欢迎在评论区留言交流。关键词:TeXstudio安装、LaTeX环境配置、中文LaTeX、TeX Live、学术论文写作更新日期:2025年10月。

weixin_51241407的博客 4500

PAT 1001 A+B Format (20 分) ——甲级

#include<iostream> #include<string> using namespace std; int main(){ int a, b, c; scanf("%d %d", &a, &b); c = a + b; if(c < 0){ c = -1 * c; printf("-"); } string str1...

RickLin_的博客 155

模仿学习算法——ATC / Diffusion Policy

最近又开始接触具身智能相关的一些工作,本文主要介绍三篇较为基础的用来做模仿学习的算法,后续有空再进一步学习分享RT系列和Pi0等文章ACT算法全称为Action Chunking with Transformers,发表于《Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware》,该论文主要内容为如何使用低成本的硬件和模仿学习算法来实的双手操作,我们主要对算法部分进行剖析ACT算法的网络结构如下图所示,使用的采用的是生成式模型VA

weixin_44580210的博客 5251

PAT 甲级 1001 1001 A+B Format (20 分) 我的解法+别人的解法

原PAT网站用户可在 https://patest.cn/bind_old_pat_user 页面绑定至拼题A账号。绑定后,原PAT网站的提交将被合并至拼题A网站用户的对应题目集中。 返回 1001 A+B Format (20 分) Calculate a+b and output the sum in standard format -- that is, the digits m...

小渣渣的博客 853

工业相机图像格式深度解析:从Mono8到Mono12的选型与应用

本文深度解析工业相机黑白图像格式,重点对比Mono8、Mono10与Mono12的核心差异。文章从位深、动态范围和数据量等关键概念切入,详细阐述了不同格式的优缺点及适用场景,为工业视觉项目中的相机选型提供实战指南,帮助用户在精度、速度与成本间做出最优决策。

weixin_29207439的博客 262

MaxEnt软件的下载与安装

1、下载网站:http://lucky-boy.ys168.com/ (这是之前在网上搜到的,里面有许多软件安装包,感谢网页主的资源共享,违权必删)

weixin_42191203的博客 2万+

PAT甲级 A1001. A+B Format (20)

1001 A+B Format (20分) Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Specification: Each input file contains one test case. Each cas

weixin_43977129的博客 320

IPCP(IP Control Protocol,IP控制协议)

IPCP(IP Control Protocol,IP控制协议)

天赐好车的博客 756

PAT 甲级 1001 A+B Format (20 分)

题目:PAT 甲级 1001 A+B Format (20 分) 经验总结: 两数之和的结果有三种可能:正数、0、负数。特别要注意0的情况,不要忽视了。 解法一(数字转字符串处理):首先将数字结果转换成字符串,判断是否是负数,是负数就先把负号输出,然后去掉负号再对剩下的数字做判断。如果要输出逗号,那么这个逗号的前面必须且至少有个数字。所以可以遍历字符串,输出当前字符后,判断从当前字符开始到...

努力努力再努力 280

2026年数字IC设计华为笔试带答案解析

这篇文章是一份数字IC设计工程师笔试的试卷结构和部分题目解析。试卷包含单选题31题(每题2分)、多选题10题(每题4分)和简答/编程题4题(每题7分),总分130分,考试时长120分钟。 摘要重点: 试卷涵盖数字IC设计的关键知识点,包括Verilog语法、时序逻辑、状态机设计、跨时钟域处理等; 题目解析详细说明了各选项的正确性,如非阻塞赋值特性(D错误)、功耗影响因素(C与组合逻辑级数弱相关)等; 包含实际工程问题,如DDR4接口电平(SSTL-1.2)、卡诺图变量排序(格雷码)等; 部分题目考察基础概念

Open 369

【数据集】中国大气污染物数据集CHAP(1km空间分辨率)-韦晶团队

中国大气污染物数据集CHAP(1km空间分辨率)-韦晶团队

WW、forever的博客 2595

PAT甲级 1001 A+B Format (20 分)

1001 A+B Format (20 分) 题目链接PAT A 1001 思路分析:这道题用字符串去解决可能比较方便,用到了C++11特性里的to_string函数,可以直接将数字转换为字符串。坑点就是它是从个位开始每三位加一个逗号,我一开始还傻乎乎的以为是从最高位。。。 AC代码: #include<iostream> using namespace std; int main(...

weixin_43684054的博客 213

32、社交媒体大数据中的情感分析与网络欺凌检测

本文探讨了社交媒体大数据在情感分析和网络欺凌检测中的应用。情感分析有助于应对自动化带来的社会变化、促进社会包容和推动环境保护。网络欺凌作为一种严重的在线危害,其检测依赖于数据预处理、特征提取与深度学习模型(如CNN、LSTM)进行分类。文章还总结了大数据在欺诈检测、医疗、制造、交通等领域的广泛应用,并分析了数据存储、处理速度、质量和技术工具等方面的挑战,提出了相应的应对策略。未来,随着技术进步,社交媒体大数据将在更多领域发挥关键作用。

cc789的博客 91

[PAT-Advanced] A1001 A+B Format (20)

PAT甲级A1001题目+分析+题解

Duke 424

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

PAT甲级 1001 A+B Format (20分)

1001 A+B Format (20分) Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Specifi...

ganlanA的博客 209

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

PAT 1001 A+B Format (20 分)

1001 A+B Format (20 分) Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Specif...

qq_40773319的博客 244

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

PAT甲级——1001 A+B Format (20分)

PAT甲级——1001 A+B Format (20分) Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Specification: Each input file contains one test case. E

linjiayina的博客 191

[PAT] 1001 A+B Format (20 分)Java

1001 A+B Format (20 分) Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits)....

Simma1101的博客 209

【JAVA】1001 A+B Format (20分) PAT甲级 PAT (Advanced Level) Practice

目录1001 A+B Format (20分)思路一:不按他们的位数分情况处理代码一:用可变数组ArrayList+字符串截取方法subString代码二:栈Stack+字符串截取方法subString思路二:因为a和b的范围较小,所以可以按他们的位数分情况处理代码一:字符串截取方法substring代码二:StringBuilder的insert方法代码三:格式化输出 printf 1001 A...

子浩的博客 1万+

PAT甲级1001 A+B Format (20分)

#PAT甲级1001 A+B Format (20分) 题目:Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Inpu...

weixin_43795683的博客 388

[C++]PAT 1001 A+B Format (20分)

Calculate a+ba + ba+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Specification: Each ...

快乐de约定的博客 2093

[PAT 甲级] 1001 A+B Format (20 分)

1001 A+B Format (20 分) Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Specif...

cp0328的博客 3390

PAT:A1001 A+B Format (20 分)

PAT:A1001 A+B Format (20 分) Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Inpu...

Ecloss 446

PAT A1001 A+B Format (20分)

1001 A+B Format (20分) Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Specification: Each input file contains one test case. Each cas

weixin_45964844的博客 190

PAT甲级 1001 A+B Format 20分

题目简介 Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). 输入信息 Each input file contains ...

qq_26073557的博客 334

PAT A1001 A+B Format (20)

题目链接: PAT A1001 A+B Format Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input S...

kkkk9501的博客 273
上一篇: PAT A1002 A+B for Polynomials(25)
下一篇: CCF CSP 201703 4.地铁修建
Crossing over
博客等级 码龄10年 6粉丝 113原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值