本帖最後由 陳品肇 於 2019-1-26 14:30 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- char a[7]="cheney";
- char b[6]={'c','h','e','n','e','y'};
- string c[2]={"che","ney"};
- string d="cheney";
- int e=3;
- char f='p';
-
- cout<<a<<endl;
- for(int i=0;i<=5;i++)
- {cout<<b[i];
- }
- cout<<endl;
- cout<<c[0]<<c[1]<<endl;
- cout<<d<<endl;
- cout<<e<<endl;
- cout<<f<<endl;
-
- system("pause");
- return 0;
- }
複製代碼 |