C ++中的字符串数组
可以使用string关键字在C++中创建字符串数组。在这里,我们正在讨论使用这种方法的C++程序。
算法
Begin Initialize the elements of array by string keyword. And take string as input. Print the array. End.
范例程式码
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
string Fruit[3] = {"Grape", "Mango", "Orange"};
cout <<"水果的名称是:"<< "\n";
for (int i = 0; i < 3; i++)
cout<< Fruit[i]<<",";
return 0;
}输出结果
水果的名称是: Grape, Mango, Orange
热门推荐
10 八一幼儿祝福语大全简短
11 公司乔迁食堂祝福语简短
12 婚礼结束聚餐祝福语简短
13 儿媳买车妈妈祝福语简短
14 毕业送礼老师祝福语简短
15 同事辞职正常祝福语简短
16 恭贺新婚文案祝福语简短
17 金店立秋祝福语简短英文
18 婆婆高寿祝福语大全简短