fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int N,i ;
  7.  
  8. cout << "請問總共有多少人?" << endl;
  9. cin >> N ;
  10. int diamond[N] ;
  11.  
  12. cout << "請依序輸入每個人離開時的鑽石顏色" << endl;
  13. cout << "說明:b代表藍色;g代表綠色" << endl;
  14. for( i=0 ; i < N ; i++ )
  15. cin >> diamond[i];
  16.  
  17.  
  18.  
  19.  
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 5288KB
stdin
b b b b b b g g
stdout
請問總共有多少人?
請依序輸入每個人離開時的鑽石顏色
說明:b代表藍色;g代表綠色