当前位置:网站首页>C language implementation of sum of two numbers [easy to understand]
C language implementation of sum of two numbers [easy to understand]
2022-07-01 17:12:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
int *twoSum(int *nums , int numsSize , int target , int *returnSize)
{
int i = 0 , j = 0;
*returnSize = 2;
int *a = (int *)malloc(sizeof(int) * 2);
for(i = 0;i<numsSize;i++)
{
for(j=i+1;j<numsSize;j++)
{
if(nums[i] + nums[j] == 0)
{
a[0] = i;
a[1] = j;
return a;
}
}
}
return a;
}
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/130942.html Link to the original text :https://javaforall.cn
边栏推荐
- vulnhub靶场-hacksudo - Thor
- ShenYu 网关开发:在本地启用运行
- (十七)DAC转换实验
- Babbitt | yuan universe daily must read: Naixue coin, Yuan universe paradise, virtual stock game Do you understand Naixue's tea's marketing campaign of "operation pull full"
- 智能运维实战:银行业务流程及单笔交易追踪
- redis -- 数据类型及操作
- 越来越多地使用 SLO 来实现可观测性|DevOps
- P2592 [zjoi2008] birthday party (DP)
- 中国氮化硅陶瓷基板行业研究与投资前景报告(2022版)
- Shenyu gateway development: enable and run locally
猜你喜欢
Vulnhub range hacksudo Thor
重磅披露!上百个重要信息系统被入侵,主机成为重点攻击目标
多线程并发之CountDownLatch阻塞等待
【Try to Hack】vulnhub DC4
多线程使用不当导致的 OOM
为什么你要考虑使用Prisma
【C语言基础】12 字符串
想做软件测试的女孩子看这里
Gold, silver and four want to change jobs, so we should seize the time to make up
[Verilog quick start of Niuke network question brushing series] ~ priority encoder circuit ①
随机推荐
Official announcement! Hong Kong University of science and Technology (Guangzhou) approved!
RadHat搭建内网YUM源服务器
Mysql database - Advanced SQL statement (2)
英特尔开源深度学习工具库 OpenVINO,将加大与本土软硬件方合作,持续开放
There is a new breakthrough in quantum field: the duration of quantum state can exceed 5 seconds
Shenyu gateway development: enable and run locally
In depth Research Report on China's disposable sanitary products production equipment industry (2022 Edition)
两数之和c语言实现[通俗易懂]
Soft test software designer full truth simulation question (including answer analysis)
PHP实现敏感词过滤系统「建议收藏」
Report on research and investment prospects of UHMWPE industry in China (2022 Edition)
Alibaba cloud, Zhuoyi technology beach grabbing dialogue AI
[flask introduction series] cookies and session
Integer array merge [JS]
SystemVerilog-结构体(二)
China metallocene polyethylene (MPE) Industry Research Report (2022 Edition)
Research and investment strategy report of neutral protease industry in China (2022 Edition)
中国一次性卫生用品生产设备行业深度调研报告(2022版)
多线程使用不当导致的 OOM
Research Report on China's enzyme Market Forecast and investment strategy (2022 Edition)