如果我有一个数组,a[100]并且我从1或开始0。当我声明时int a[100],我的数组多长时间?
它总是从开始计数0?如果是,它将是一个带有101空格的数组。
#include <iostream>
using namespace std;
int main()
{
float time[20]; //
int a, first = 20, y, x;
for (x = 1; x < 21; x++) {
cout << "Enter the time of the person number " << x << " : ";
cin >> time[x];
}
for (y = 1; y < 20; y++) {
if (time[y] < first) {
first = time[y];
a …Run Code Online (Sandbox Code Playgroud) c++ ×1