C ++の問題(基本的なC ++の文)

1.sort()関数の使用

#include<algorithm>
sort(caiprice, caiprice + n);
 sort(a,a+10);

(1)配列の先頭アドレスをソートする最初のものです。

(2)第二のアドレス(アドレスのソートする最後のもの)の端部であります

2.C ++の基本的な声明

#include<bits/stdc++.h>

using namespace std;

3.vectorオブジェクトの初期化入力(使用一back)

vector<int>x;
	cin >> n >> k ;
	
	for (int i = 0; i < n; i++)
	{
		int temp;
		cin >> temp;
		x.push_back(temp);
	}
	
公開された44元の記事 ウォンの賞賛9 ビュー3382

おすすめ

転載: blog.csdn.net/puying1/article/details/83902086