当前位置:网站首页>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
边栏推荐
- 提交review时ReviewBoard出现500错误解决方法
- 可迭代对象与迭代器、生成器的区别与联系
- (27) Open operation, close operation, morphological gradient, top hat, black hat
- 深度优先遍历和广度优先遍历[通俗易懂]
- Gold, silver and four want to change jobs, so we should seize the time to make up
- [live broadcast appointment] database obcp certification comprehensive upgrade open class
- In depth Research Report on China's disposable sanitary products production equipment industry (2022 Edition)
- Chinese diosgenin market forecast and investment strategy report (2022 Edition)
- Free lottery | explore the future series of blind box digital copyright works of "abadou" will be launched on the whole network!
- Research Report on development monitoring and investment prospects of China's smart environmental protection industry (2022 Edition)
猜你喜欢

【牛客网刷题系列 之 Verilog快速入门】~ 优先编码器电路①

SystemVerilog-结构体(二)
![[mathematical modeling] [matlab] implementation of two-dimensional rectangular packing code](/img/de/1f572c62a0d034da9a8acb5c2f9602.jpg)
[mathematical modeling] [matlab] implementation of two-dimensional rectangular packing code

整形数组合并【JS】

存在安全隐患 起亚召回部分K3新能源

Redis6.0 new features

Iommu/smmuv3 code analysis (10) page table operation

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

英特尔开源深度学习工具库 OpenVINO,将加大与本土软硬件方合作,持续开放

Mysql database - Advanced SQL statement (2)
随机推荐
[C language foundation] 12 strings
In aks, use secret in CSI driver mount key vault
荣威 RX5 的「多一点」产品策略
求求你们,别再刷 Star 了!这跟“爱国”没关系!
官宣!香港科技大学(广州)获批!
Jojogan practice
提交review时ReviewBoard出现500错误解决方法
C语言输入/输出流和文件操作
pyqt5中,在控件上画柱状图
[Supplément linguistique c] déterminer quel jour est demain (date de demain)
剑指 Offer II 105. 岛屿的最大面积
Sword finger offer 20 String representing numeric value
LeetCode中等题之TinyURL 的加密与解密
Yyds dry inventory MySQL RC transaction isolation level implementation
走进微信小程序
Sword finger offer II 015 All modifiers in the string
China BMS battery management system Market Research Report (2022 Edition)
Official announcement! Hong Kong University of science and Technology (Guangzhou) approved!
String的trim()和substring()详解
Cookies and session keeping technology