- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- string str1="Hello! My name is Tony!";
- cout<<str1<<endl;
-
- char str2[7]={"Hello!"};
- cout<<str2<<endl;
- char str3[6]={'H','e','l','l','o','!'};
- for(int i=0; i<=5; i++)
- cout<<str3[i];
- cout<<endl;
-
- string str4[5]={"Hello! ","My ","name ","is ","Tony!"};
- for(int i=0; i<=4; i++)
- cout<<str4[i];
- cout<<endl;
-
- system("pause");
- return 0;
- }
複製代碼 |