当前位置:网站首页>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;
}
边栏推荐
- Hands on deep learning (40) -- short and long term memory network (LSTM)
- Hands on deep learning (44) -- seq2seq principle and Implementation
- Sword finger offer 31 Stack push in and pop-up sequence
- system design
- 转载:等比数列的求和公式,及其推导过程
- Remove linked list elements
- 【Day2】 convolutional-neural-networks
- Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 1
- leetcode1-3
- Realsense d435 d435i d415 depth camera obtains RGB map, left and right infrared camera map, depth map and IMU data under ROS
猜你喜欢

【OpenCV 例程200篇】218. 多行倾斜文字水印

Hands on deep learning (45) -- bundle search

Dynamic address book

MySQL develops small mall management system

Dynamic memory management

Jianzhi offer 04 (implemented in C language)

system design

uniapp 小于1000 按原数字显示 超过1000 数字换算成10w+ 1.3k+ 显示

Three schemes of ZK double machine room

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
随机推荐
Talk about scalability
C language structure to realize simple address book
Static comprehensive experiment ---hcip1
Histogram equalization
按键精灵打怪学习-识别所在地图、跑图、进入帮派识别NPC
Hands on deep learning (40) -- short and long term memory network (LSTM)
Reprint: summation formula of proportional series and its derivation process
Doris / Clickhouse / Hudi, a phased summary in June
Leetcode48. Rotate image
Rhcsa day 10 operation
Pod management
Press the button wizard to learn how to fight monsters - identify the map, run the map, enter the gang and identify NPC
Rhcsa - day 13
2. Data type
Work order management system OTRs
Hands on deep learning (44) -- seq2seq principle and Implementation
【Day2】 convolutional-neural-networks
Number of relationship models
Es advanced series - 1 JVM memory allocation
【Day1】 deep-learning-basics