返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     float g,gg,ggg;
  7.     cout<<"請輸入梯形的上底(公分):" ;
  8.     cin>>g;
  9.     cout<<"請輸入梯形的下底(公分):" ;
  10.     cin>>gg;
  11.     cout<<"請輸入梯形的高(公分):" ;
  12.     cin>>ggg;
  13.     cout<<"上底"<<g<<"公分,下底"<<gg<<"高"<<ggg<<"公分的梯形,面積為"<<(g+gg)*ggg/2<<"平方公分."<<endl;
  14.     system("pause");
  15.     return 0;
  16. }
複製代碼
༼ つ ◕_◕ ༽つ༼ つ ◕_◕ ༽つ༼ つ ◕_◕ ༽つ

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int g;
  7.     cout<<"請輸入一正整數: ";
  8.     cin>>g;
  9.     cout<<g<<"的因數有: ";
  10.     for(int i=1; i<=g; i++)
  11.     {
  12.          if(g%i==0)
  13.              cout<<i<<" ";
  14.     }
  15.     cout<<endl;
  16.     system("pause");
  17.     return 0;   
  18. }
複製代碼
༼ つ ◕_◕ ༽つ༼ つ ◕_◕ ༽つ༼ つ ◕_◕ ༽つ

TOP

返回列表