返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. void hello()
  5. {               
  6.         cout<<"HELLO!!"<<endl;
  7. }
  8. int main()
  9. {
  10.    hello();
  11.    system("pause");
  12.    return 0;
  13. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. void hello(){
  5.         cout<<"這是hello函式"<<endl;
  6. }

  7. int main(){
  8.       
  9.         cout<<"這是主函式的hello"<<endl;
  10.         hello();
  11.         system("pause");
  12.         return 0;
  13. }
複製代碼
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. void hello()
  5. {               
  6.         cout<<"這是hello函式"<<endl;
  7. }
  8. int myplus(int x,int y,int z){
  9.         return x+y+z;
  10. }
  11. int main()
  12. {
  13.         cout<<"myplus 1+2+3="<<myplus(1,2,3)<<endl;
  14.         cout<<"這是主函式的hello"<<endl;
  15.    hello();
  16.    system("pause");
  17.    return 0;
  18. }
複製代碼

TOP

返回列表