作者 lanyuan [actionscript] 2012-04-22 17:36 (点击下载)

  1. //game stats
  2. //demonstates declaring and initializing variables
  3. #include<iostream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int score;
  9. double distance;
  10. char playAgain;
  11. bool shieldsUp;
  12.  
  13. short lives,aliensKilled;
  14.  
  15. score=0;
  16. distance=1200.76;
  17. playAgain='y';
  18. shieldsUp=true;
  19. lives=3;
  20. aliensKilled=10;
  21. double engineTemp=6572.89;
  22. cout<<"nscore:"<<score<<endl;
  23. cout<<"distance:"<<distance<<endl;
  24. cout<<"playAgain:"<<playAgain<<endl;
  25. //skipping shieldsUp since you don't generally print Boolean values
  26. cout<<"lives:"<<lives<<endl;
  27. cout<<"aliensKilled:"<<aliensKilled<<endl;
  28. cout<<"enginerTemp:"<<engineTemp<<endl;
  29.  
  30. int fuel;
  31. cout<<"nHow much fuel?";
  32. cin>>fuel;
  33. cout<<"fuel:"<<fuel<<endl;
  34. typedef unsigned short int ushort;
  35. ushort bonus=10;
  36. cout<<"nbonus:"<<bonus<<endl;
  37.  
  38. return 0;
  39. }

提交下面的校正或者修改. (点击这里开始一个新的帖子)
姓名: 在 cookie 中记住我的名字

屏幕抓图:(jpeg 或 png)