第十三周项目一b

以你之姓@ 2022-08-14 01:47 255阅读 0赞
  1. 问题及代码:
  2. /*
  3. *Copyright (c) 2014,烟台大学计算机学院
  4. *ALL right reserved
  5. *文件名;seventy.cpp
  6. *作者;童宇
  7. *完成日期2014年11月20日
  8. *版本号v1.0
  9. *问题描述:数组大折腾
  10. *输入描述:
  11. *程序输出:
  12. */
  13. #include <iostream>
  14. using namespace std;
  15. const int size=10;
  16. int main()
  17. {
  18. int sz[size]= {1,2,3,4,5,6,7,8,9,10},i;
  19. cout<<"由后往前,数组中的值是:\n";
  20. for(i=10; i>=1; i--)
  21. {
  22. if(i%5==0)
  23. cout<<endl;
  24. cout <<sz[i]<<" ";
  25. }
  26. cout<<endl;
  27. cout<<endl;
  28. cout<<endl;
  29. for(i=10; i>=1; i--)
  30. {
  31. if(i%5==0)
  32. cout<<endl;
  33. cout <<2*sz[i]<<" ";
  34. }
  35. return 0;
  36. }

运行结果:

Center

发表评论

表情:
评论列表 (有 0 条评论,255人围观)

还没有评论,来说两句吧...

相关阅读