返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int c(int,int);
  5. int c(int,int,int);

  6. int main()
  7. {   
  8.     int x,y,z;
  9.     cout<<"三個數"<<endl;
  10.     cin>>x>>y>>z;
  11.     cout<<"前兩數相加"<<c(x,y)<<endl;
  12.     cout<<"三數相加"<<(x,y,z)<<endl;
  13.     {
  14.       int c(int x,int y);                                   
  15.        return x+y;                                 
  16.               
  17.     }
  18.     {
  19.      int c(int x,int y,int z);                                   
  20.        return x+y+z;                                    
  21.      
  22.     }
  23.    
  24.     system("pause");
  25.     return 0;   
  26. }
複製代碼

TOP

返回列表