当前位置:网站首页>Write a program to judge whether the two arrays are equal, and then write a similar program to compare the two vectors.
Write a program to judge whether the two arrays are equal, and then write a similar program to compare the two vectors.
2022-07-04 10:26:00 【qq_ fifty-eight million seven hundred and thirty-six thousand t】
/* Write a program to determine whether the two arrays are equal , Then write a similar program
Ordinal comparison of two vector.*/
/*
bool judge1(size_t* a, size_t* b, int n)
{
for (size_t i = 0; i != n; i++)
if (a[i] != b[i])
return false;
else
return true;
}
int main(void)
{
size_t array[10], array1[11];
for (size_t i = 0; i != 10; i++)
{
array[i] = i;
array1[i] = i;
}
if (judge1(array, array1, 10))
cout << " equal ";
else
cout << " It's not equal ";
return 0;
}
*/
bool judge1(vector<size_t>a, vector<size_t>b, int n)
{
for (size_t i = 0; i != n; i++)
if (a[i] != b[i])
return false;
else
return true;
}
int main(void)
{
vector<size_t>array, array1;
for (size_t i = 0; i != 10; i++)// Array modification for comparison
{
array.push_back(i);
array1.push_back(i);
}
if (judge1(array, array1, 10))
cout << " equal ";
else
cout << " It's not equal ";
return 0;
}
边栏推荐
- Kotlin: collection use
- VLAN part of switching technology
- Lavel document reading notes -how to use @auth and @guest directives in lavel
- Dynamic memory management
- Use C to extract all text in PDF files (support.Net core)
- 入职中国平安三周年的一些总结
- Static comprehensive experiment ---hcip1
- Latex arranges single column table pictures in double column format articles
- Rhsca day 11 operation
- 原生div具有编辑能力
猜你喜欢
今日睡眠质量记录78分
BGP ---- border gateway routing protocol ----- basic experiment
Static comprehensive experiment ---hcip1
【OpenCV 例程200篇】218. 多行倾斜文字水印
Occasional pit compiled by idea
RHCE - day one
Application of safety monitoring in zhizhilu Denggan reservoir area
Servlet基本原理与常见API方法的应用
Dynamic memory management
Dynamic memory management
随机推荐
Lavel document reading notes -how to use @auth and @guest directives in lavel
2020-03-28
Rhcsa operation
六月份阶段性大总结之Doris/Clickhouse/Hudi一网打尽
Hands on deep learning (45) -- bundle search
Reprint: summation formula of proportional series and its derivation process
If the uniapp is less than 1000, it will be displayed according to the original number. If the number exceeds 1000, it will be converted into 10w+ 1.3k+ display
If you don't know these four caching modes, dare you say you understand caching?
What is an excellent architect in my heart?
Native div has editing ability
Hands on deep learning (37) -- cyclic neural network
Exercise 7-8 converting strings to decimal integers (15 points)
System.currentTimeMillis() 和 System.nanoTime() 哪个更快?别用错了!
Leetcode48. Rotate image
PHP code audit 3 - system reload vulnerability
The time difference between the past time and the present time of uniapp processing, such as just, a few minutes ago, a few hours ago, a few months ago
Velodyne configuration command
DDL statement of MySQL Foundation
【Day2】 convolutional-neural-networks
7-17 crawling worms (15 points)