当前位置:网站首页>42.【vector简单列题】
42.【vector简单列题】
2022-07-30 06:29:00 【李在奋斗……】

#include <vector>
#include <iostream>
using namespace std;
int main()
{
vector<int> str_a(13);
for (int i = 0; i < 13; i++)
{
cout << "请输入第" << i + 1 << "个数为:" << endl;
cin >> str_a[i];
}
for (int j = 0; j < 13; j++)
{
if (str_a[j] == 3)
{
str_a.erase(str_a.begin() + j, str_a.begin() + j);
}
else
{
cout << str_a[j] << " ";
}
}
return 0;
}

边栏推荐
猜你喜欢

02 多线程与高并发 - synchronized 解析

潜心打磨,主动求变——这群技术排头兵,如何做好底层开发这件事?

The first artificial intelligence safety competition officially launched

MySql详解基础

Mybitatis相关配置文件

ARM体系结构概述

What new materials are used in the large aircraft C919?

DP5340 domestic replacement for CM5340 stereo audio A/D converter chip

C# 获取系统已安装的.NET版本

How to calculate the daily cumulative capital flow one by one in real time
随机推荐
Handler消息机制-Native层
谷粒商城--环境部署(2022/7/28最新)
Electron使用romote报错 : Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
【雷达目标检测】恒定阈值法和恒虚警(CFAR)法及代码实现
goto语句
WinForm(一):开始一个WinForm程序
go : 使用gorm创建数据库记录
DP5340国产替代CM5340立体声音频A/D转换器芯片
Go uses the mencached cache
ArrayList
MySQL master-slave replication configuration construction, one step in place
LSF提交作业命令--bsub
[GO语言基础] 一.为什么我要学习Golang以及GO语言入门普及
interface
RT-Thread-GD32的SPI在切换同一总线不同挂载设备时会出现切换后乱发送数据的问题
Vue2进阶篇-编程式路由导航、缓存路由组件、路由的激活与失活
taro package compilation error
redis实现分布式锁的原理
Electron之初出茅庐——搭建环境并运行第一个程序
General Lei's personal blog to see