当前位置:网站首页>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
边栏推荐
- 【C语言补充】判断明天是哪一天(明天的日期)
- AI高考志愿填报:大厂神仙打架,考生付费围观
- 反射型XSS漏洞
- String的trim()和substring()详解
- Gold, silver and four want to change jobs, so we should seize the time to make up
- Basic usage of Frida
- In depth Research Report on China's disposable sanitary products production equipment industry (2022 Edition)
- 阿里云李飞飞:中国云数据库在很多主流技术创新上已经领先国外
- Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
- Leetcode records - sort -215, 347, 451, 75
猜你喜欢

【Try to Hack】vulnhub DC4

Redis6.0 新功能

多线程使用不当导致的 OOM

String类

SQL question brushing 1050 Actors and directors who have worked together at least three times
![[live broadcast appointment] database obcp certification comprehensive upgrade open class](/img/50/83a533f4e8a60f90e03b991385c08d.jpg)
[live broadcast appointment] database obcp certification comprehensive upgrade open class

(十七)DAC转换实验

C語言輸入/輸出流和文件操作

美国国家安全局(NSA)“酸狐狸”漏洞攻击武器平台技术分析报告

National Security Agency (NSA) "sour Fox" vulnerability attack weapon platform technical analysis report
随机推荐
China BMS battery management system Market Research Report (2022 Edition)
荣威 RX5 的「多一点」产品策略
Iommu/smmuv3 code analysis (10) page table operation
Alibaba cloud, Zhuoyi technology beach grabbing dialogue AI
Judge whether a binary tree is a balanced binary tree
The amazing open source animation library is not only awesome, but also small
Introduction to software engineering - Chapter 6 - detailed design
换掉UUID,NanoID更快更安全!
Computed property “xxx“ was assigned to but it has no setter.
In depth Research Report on China's disposable sanitary products production equipment industry (2022 Edition)
Hi Fun Summer, play SQL planner with starrocks!
ShenYu 网关开发:在本地启用运行
SQL注入漏洞(Mysql与MSSQL特性)
【C补充】【字符串】按日期排序显示一个月的日程
Redis 分布式锁
Basic usage of Frida
[Supplément linguistique c] déterminer quel jour est demain (date de demain)
【C語言補充】判斷明天是哪一天(明天的日期)
中国酶制剂市场预测与投资战略研究报告(2022版)
AI高考志愿填报:大厂神仙打架,考生付费围观