標題:
陣列 (二)
[打印本頁]
作者:
王瑞喻
時間:
2019-9-6 12:56
標題:
陣列 (二)
本帖最後由 王瑞喻 於 2020-7-12 16:14 編輯
[attach]7076[/attach]
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
// 0 1 2 3 4 5 6 7
int a[8]= {30, 31, 33, 32, 31, 35, 28 ,29};
string c[8]= {"忠","孝","仁","愛","信","義","和","平"}; //字串陣列
for(int i=0;i<8;i++)
{
cout<<"5年"<<c[i]<<"班有"<<a[i]<<"人"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
曾宥程
時間:
2019-9-7 12:07
本帖最後由 曾宥程 於 2019-9-28 10:13 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
// 0 1 2 3 4 5 6 7
int a[]= {30, 31, 33, 32, 31, 35, 28 ,29};
string c[]= {"忠","孝","仁","愛","信","義","和","平"}; //字串陣列
for(int i=0;i<8;i++)
{
cout<<"5年"<<c[i]<<"班有"<<a[i]<<"人"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
郭哲維
時間:
2019-9-8 07:34
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a[]= {30, 31, 33, 32, 31, 35, 28 ,29};
string c[]= {"忠","孝","仁","愛","信","義","和","平"};
for(int i=0;i<8;i++)
{
cout<<"5年"<<c[i]<<"班有"<<a[i]<<"人"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
林孟蓁
時間:
2019-9-8 12:35
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a[]= {30, 31, 33, 32, 31, 35, 28 ,29};
string c[]= {"忠","孝","仁","愛","信","義","和","平"};
for(int i=0;i<8;i++)
{
cout<<"5年"<<c[i]<<"班有"<<a[i]<<"人"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
王翎璇
時間:
2019-9-14 12:24
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
// 0 1 2 3 4 5 6 7
int a[]= {30, 31, 33, 32, 31, 35, 28 ,29};
string c[]= {"忠","孝","仁","愛","信","義","和","平"}; //字串陣列
for(int i=0;i<8;i++)
{
cout<<"5年"<<c[i]<<"班有"<<a[i]<<"人"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
鄭羽捷
時間:
2019-9-14 23:22
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a[]= {30, 31, 33, 32, 31, 35, 28, 29 };
string c[]={"忠","孝","仁","愛","信","義","和","平"};
for(int i=0; i<=8; i++)
{
cout<<"5年"<<c[i]<<"人"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
駱顗安
時間:
2020-7-23 19:24
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int X[8]={30,31,33,32,31,35,28,29};
string m[8]={"忠","孝","仁","愛","信","義","和","平"};
for(int i=0;i<8;i+=1)
cout<<"5年"<<m[i]<<"班有"<<X[i]<<"人"<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2