有人可以在 c++ 中解释数组的这种输入
Can someone explain this input of array in c++
这是我的代码,数组的输入是什么?我只是想了解更多关于此代码中的输入的信息
int n;
float c[10][3];
cout<<“Enter the number of vertices :”;
cin>>n;
for (i=0;i<n;i++)
{
cout<<“Enter the coordinates of the vertex :”,i+1;.
cin>>c[i][0]>>c[i][1];
c[i][2]=1
}
您正在以这种形式获取值
阵列 C
x y 1
x1 y1 1
.
.
.
x9 y9 1
基本上你的 i 遍历二维数组的所有行,并分别为第 1 和第 2 个位置获取 2 个输入。 第三个位置始终设置为 1。
相关文章:
- 检查TCHAR数组输入是否为带符号整数C++
- C++数组输入不接受一定数量的整数
- 为什么我的代码无法处理大型数组输入(>10000)?
- 我正在努力处理多维数组输入和输出,我管理输入,但是打印无法按计划工作
- 使用无符号字符数组输入十六进制数
- C++用用户输入在循环中填充 char 数组:输入整个字符串时到底发生了什么?
- 如何从用户获取数组输入
- C 2x2数组输入线
- 字符数组输入限制
- 将字符串数组输入到函数C++
- C++:如何将普通话(字符串)分配给用户使用数组输入的数字 &运算符问题
- 数组排序、数组输入、数组输出
- 将字符数组输入stdin
- 如何在 c++ 中为对象数组输入字符串
- 如何在c++ mex文件中访问多维数组输入
- 读取文件并将其作为整型数组输入
- 从c++文件中获取输入(矩阵数组输入)
- 数组输入不工作
- 函数结构数组输入cin问题
- 结束数组输入(c++行业标准)