当前位置:网站首页>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;
}
边栏推荐
- Talk about scalability
- 有老师知道 继承RichSourceFunction自定义读mysql怎么做增量吗?
- Exercise 7-8 converting strings to decimal integers (15 points)
- Ruby时间格式转换strftime毫秒匹配格式
- Latex arranges single column table pictures in double column format articles
- leetcode729. My schedule 1
- [FAQ] summary of common causes and solutions of Huawei account service error 907135701
- 【Day2】 convolutional-neural-networks
- Use C to extract all text in PDF files (support.Net core)
- DML statement of MySQL Foundation
猜你喜欢

Reprint: summation formula of proportional series and its derivation process

Rhcsa day 10 operation

Application of safety monitoring in zhizhilu Denggan reservoir area

基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 1

基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 2

183 sets of free resume templates to help everyone find a good job

A little feeling

入职中国平安三周年的一些总结

Machine learning -- neural network (IV): BP neural network

【Day1】 deep-learning-basics
随机推荐
Sword finger offer 31 Stack push in and pop-up sequence
BGP advanced experiment
System. Currenttimemillis() and system Nanotime (), which is faster? Don't use it wrong!
Devop basic command
Exercise 7-4 find out the elements that are not common to two arrays (20 points)
Four characteristics and isolation levels of database transactions
Realsense of d435i, d435, d415, t265_ Matching and installation of viewer environment
Basic principle of servlet and application of common API methods
The most detailed teaching -- realize win10 multi-user remote login to intranet machine at the same time -- win10+frp+rdpwrap+ Alibaba cloud server
2020-03-28
Exercise 7-8 converting strings to decimal integers (15 points)
Batch distribution of SSH keys and batch execution of ansible
基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 1
使用 C# 提取 PDF 文件中的所有文字(支持 .NET Core)
Exercise 7-2 finding the maximum value and its subscript (20 points)
Use the data to tell you where is the most difficult province for the college entrance examination!
Machine learning -- neural network (IV): BP neural network
MPLS: multi protocol label switching
5g/4g wireless networking scheme for brand chain stores
Rhcsa - day 13