c_cpp填()(代码片段)

author author     2023-01-09     221

关键词:

#include <iostream>
using namespace std;

int main() 
	int arr1[10] =  0 ;
	int arr2[10] =  1 ;
	for (int i = 0; i < 10; i++) 
		cout << arr1[i] << " ";
	
	cout << endl;
	// 0 0 0 0 0 0 0 0 0 0
	for (int i = 0; i < 10; i++) 
		cout << arr2[i] << " ";
	
	cout << endl;
	// 1 0 0 0 0 0 0 0 0 0
	fill(arr1, arr1 + 10, 2);
	for (int i = 0; i < 10; i++) 
		cout << arr1[i] << " ";
	
	cout << endl;
	// 2 2 2 2 2 2 2 2 2 2
	fill(arr2 + 3, arr2 + 7, 2);
	for (int i = 0; i < 10; i++) 
		cout << arr2[i] << " ";
	
	cout << endl;
	// 1 0 0 2 2 2 2 0 0 0
	return 0;

#include <iostream>
using namespace std;
const int N = 5;

int main() 
	int arr1[N][N];
	fill(arr1[0], arr1[0] + N * N, 5);
	for (int i = 0; i < N; i++) 
		for (int j = 0; j < N; j++) 
			cout << arr1[i][j] << " ";
		
		cout << endl;
	
	// 5 5 5 5 5
	// 5 5 5 5 5
	// 5 5 5 5 5
	// 5 5 5 5 5
	// 5 5 5 5 5
	return 0;

c_cpp^(代码片段)

查看详情

c_cpp最后的片段(代码片段)

查看详情

c_cpp代码信号08(代码片段)

查看详情

c_cpp幽灵示例代码(代码片段)

查看详情

c_cpp幽灵示例代码(代码片段)

查看详情

c_cpp游戏代码注入(代码片段)

查看详情

c_cpp界()(代码片段)

查看详情

c_cpp输入(代码片段)

查看详情

c_cpp分类(代码片段)

查看详情

c_cpp访问(代码片段)

查看详情

c_cpp阵列(代码片段)

查看详情

c_cpp功能(代码片段)

查看详情

c_cpp包括(代码片段)

查看详情

c_cpp延缓(代码片段)

查看详情

c_cpp冒泡(代码片段)

查看详情

c_cpp向量(代码片段)

查看详情

c_cpp加(代码片段)

查看详情

c_cpp测试(代码片段)

查看详情