使用Player FM应用程序离线!
E se a Ficção C++[i]entífica fosse real? #93 - Dois C++ a Frente
Manage episode 293599220 series 2586587
int main ()
{
std::vector nums = {1};
int val = 0;
int pos = 0;
bool check = false;
auto i = nums.begin();
while (i !=nums.end())
{
if((*i) != val)
{
i++;
pos++;
}
else
{
check = true;
break;
}
}
if (!check)
{
pos = 0;
auto j = nums.begin();
while (j != nums.end())
{
if (val > (*j))
{
j++;
pos++;
}
else
{
check = true;
break;
}
}
}
cout << pos << std::endl;
for(int x : nums)
{
cout << x << "\t";
}
return ;
}
108集单集
Manage episode 293599220 series 2586587
int main ()
{
std::vector nums = {1};
int val = 0;
int pos = 0;
bool check = false;
auto i = nums.begin();
while (i !=nums.end())
{
if((*i) != val)
{
i++;
pos++;
}
else
{
check = true;
break;
}
}
if (!check)
{
pos = 0;
auto j = nums.begin();
while (j != nums.end())
{
if (val > (*j))
{
j++;
pos++;
}
else
{
check = true;
break;
}
}
}
cout << pos << std::endl;
for(int x : nums)
{
cout << x << "\t";
}
return ;
}
108集单集
所有剧集
×欢迎使用Player FM
Player FM正在网上搜索高质量的播客,以便您现在享受。它是最好的播客应用程序,适用于安卓、iPhone和网络。注册以跨设备同步订阅。