標題:
陣列 (三)
[打印本頁]
作者:
tonyh
時間:
2014-1-11 17:11
標題:
陣列 (三)
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string str1="hello";
cout<<str1<<endl;
char str2[6]="hello";
for(int i=0; i<=4; i++)
cout<<str2[i];
cout<<endl;
char str3[5]={'h','e','l','l','o'};
for(int i=0; i<=4; i++)
cout<<str3[i];
cout<<endl;
string str4[2]={"he","llo"};
for(int i=0; i<=1; i++)
cout<<str4[i];
cout<<endl;
system("pause");
return 0;
}
複製代碼
作者:
施伯叡
時間:
2014-1-11 17:16
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string str1="hello";
cout<<str1<<endl;
char str2[6]="hello";
for(int i=0; i<=4; i++)
cout<<str2[i];
cout<<endl;
char str3[5]={'h','e','l','l','o'};
for(int i=0; i<=4; i++)
cout<<str3[i];
cout<<endl;
string str4[2]={"he","llo"};
for(int i=0; i<=1; i++)
cout<<str4[i];
cout<<endl;
system("pause");
return 0;
}
複製代碼
作者:
張峻瑋
時間:
2014-1-11 17:17
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string str1="hello";
cout<<str1<<endl;
char str2[6]="hello";
for(int i=0;i<=4;i++)
cout<<str2[i];
cout<<endl;
char str3[5]={'h','e','l','l','o'};
for(int i=0;i<=4;i++)
cout<<str3[i];
cout<<endl;
string str4[2]={"he","llo"};
for(int i=0;i<=1;i++)
cout<<str4[i];
cout<<endl;
system("pause");
return 0;
}
複製代碼
作者:
周雍程
時間:
2014-1-11 17:19
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
string str1="hello";
cout<<str1<<endl;
char str2[6]="hello";
for(int i=0; i<=4; i++)
cout<<str2[i];
cout<<endl;
char str3[5]={'h','e','l','l','o'};
for(int i=0; i<=4; i++)
cout<<str3[i];
cout<<endl;
string str4[2]={"he","llo"};
for(int i=0; i<=1; i++)
cout<<str4[i];
cout<<endl;
system("pause");
return 0;
}
複製代碼
作者:
張郁偵
時間:
2014-1-11 17:21
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string str1="hello";
cout<<str1<<endl;
char str2[6]="hello";
for(int i=0; i<=4; i++)
cout<<str2[i];
cout<<endl;
char str3[5]={'h','e','l','l','o'};
for(int i=0; i<=4; i++)
cout<<str3[i];
cout<<endl;
string str4[2]={"he","llo"};
for(int i=0; i<=1; i++)
cout<<str4[i];
cout<<endl;
system ("pause");
return 0;
}
複製代碼
作者:
張郁庭
時間:
2014-1-11 17:22
#include<iostream>
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string str1="hello";
cout<<str1<<endl;
char str2[6]="hello";
for(int i=0;i<=4;i++)
cout<<str2[i];
cout<<endl;
char str3[5]={'h','e','l','l','o'};
for(int i=0;i<=4;i++)
cout<<str3[i];
cout<<endl;
string str4[2]={"he","llo"};
for(int i=0;i<=1;i++)
cout<<str4[i];
cout<<endl;
system ("pause");
return 0;
}
複製代碼
作者:
張彥承
時間:
2014-1-11 17:27
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string str1="hello";
cout<<str1<<endl;
char str2[6]="hello";
for (int i=0;i<=4;i++)
cout<<str2[i];
cout<<endl;
char str3[5]={'h','e','l','l','o'};
for(int i=0;i<=4;i++)
cout<<str3[i];
cout<<endl;
string str4[2]={"he","llo"};
for(int i=0;i<=1;i++)
cout<<str4[i];
cout<<endl;
system("pause");
return 0;
}
複製代碼
作者:
劉得旗
時間:
2014-1-11 17:28
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string str1="hello";
cout<<str1<<endl;
char str2[6]="hello";
for(int i=0; i<=4; i++)
cout<<str2[i];
cout<<endl;
char str3[5]={'h','e','l','l','o'};
for(int i=0; i<=4; i++)
cout<<str3[i];
cout<<endl;
string str4[2]={"he","llo"};
for(int i=0; i<=1; i++)
cout<<str4[i];
cout<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2