C++作业题与答案(3)
{ int i,j,a,b;
for(i=-3;i<=3;i++) { a=abs(i);
for(j=-3;j<=3;j++) { b=abs(j); (a>b)?cout<<\ } cout< 3 3 3 3 3 3 3 3 2 2 2 2 2 3 3 2 1 1 1 2 3 3 2 1 0 1 2 3 3 2 1 1 1 2 3 3 2 2 2 2 2 3 3 3 3 3 3 3 3 Press any key to continue*/ /*/ e9 ② #include {signed i=4;int x,y=4; do {x=(4-abs(i))*2; for(cout< if(i%2==0) y--;}while(i>=-4); } //*/ /* 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 Press any key to continue*/ /*/ e9 ③ #include x=(4-abs(i))*2; for(cout< if(abs(i)>=abs(j)) cout< 4 4 3 4 4 3 2 3 4 4 3 2 1 2 3 4 4 3 2 1 0 1 2 3 4 4 3 2 1 2 3 4 4 3 2 3 4 4 3 4 4 Press any key to continue*/ /*/ e10 递推法 #include cout<<\cin>>n; if(n>=4) {for(n=n-3;n>0;n--) sum=sum+1;} cout<<\ //*/ /* How many years? 10 The nunber of cow is 7 Press any key to continue*/ /*/ e10递归法 #include cout<<\cin>>n; x=cow(n); cout<<\int cow(int n) {if(n<=3) return 0; else return cow(n-1)+1 ;} /* How many years? 10 The nunber of cow is 7 Press any key to continue*/ /*/ e11 #include void fc(int n){if(!n)return;fc(n/10);cout< void fe(int n){char s[]=\void ff(int a){if(!a)return;ff(a/10);fe(a);cout<<\void main() {long a;cout<<\请输入一个无符号整数: \cout<<\ \\n\ cout<<\ \\n\cout<<\ \\n\} //*/ /* 请输入一个无符号整数: 789 (1) 7 78 789 (2) 987 (3) 0111 1000 1001 Press any key to continue //*/ /*/ e12 #include { if(w==1) cout< for(int i=1; i<=w; i++) cout < void main() {print(5);} //*/ /* 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 Press any key to continue*/ /*/ e13 #include {int m=0,n=0,t;double x,y; do {x=10*n+6; t=pow(10,m); if(n%t==0&&n!=0) m++; y=n+6*pow(10,m); n++;}while(y!=4*x); cout< 615384=4*153846 Press any key to continue*/ /*/ e14 ① #include {double a=3.14;int b=10; char c='W'; display(a); display(b); display(c); } void display(double a) {cout<<\void display(int b) {cout<<\void display(char c) {cout<<\//*/ /* a double:3.14 a int:10 a char:W Press any key to continue */ /*/ e14 ② // my function.h int Fabricate(int m,int n) int Multi(int m,int n) // my Fabricate.cpp int Fabricate(int m,int n) { int g if (n==0&&m==n) return 1; else g=n*Fabricate(n-1); return Multi(m,n)/g; } // my Multi.cpp int Multi(int m,int n) {if (m=n) return 1; else return m*Multi(m-1); } // my main.cpp #include
相关推荐:
- [建筑文档]2018年公需课:专业技术人员创新能力与
- [建筑文档]2013年福建教师招考小学数学历年真题
- [建筑文档]高中信息技术课flash知识点总结 - 图文
- [建筑文档]电工实训 - 图文
- [建筑文档]最高院公告案例分析100篇(民商篇)
- [建筑文档]南开中学高2017级14-15学年(上)期末
- [建筑文档]五粮液集团战略分析
- [建筑文档]鲁教版(2012秋季版)九年级化学 酸碱
- [建筑文档]超星尔雅2017中国哲学概论自整理题库答
- [建筑文档]关于成为海口金盘饮料公司材料独家供货
- [建筑文档]LNG学习资料第一册 基础知识 - 图文
- [建筑文档]四年级品社下册《好大一个家》复习资料
- [建筑文档]现阶段领导权力腐败的特点及发展趋势
- [建筑文档]魏晋南北朝诗歌鉴赏—嵇康
- [建筑文档]坚持追求真爱是理智的行为 正方一辩稿
- [建筑文档]湘西州刑释解教人员帮教安置工作存在的
- [建筑文档]园林工程试题库及答案
- [建筑文档]计算机长期没有向WSUS报告状态
- [建筑文档]日语最新流行语
- [建筑文档]B62-016 景观进场交底专题会议
- 2018年中考语文课内外古诗词鉴赏专题复
- 高考试题研究心得体会
- C语言基础题及答案
- 电气控制及PLC习题及答案
- 都昌小学家长学校汇报材料
- GMAT作文模板正确使用方法
- 俄军办坦克大赛:中国99式有望与豹2A6
- 成本会计练习题
- 酒店餐饮业最流行的5S管理方法
- 2014-2015学年山东省菏泽市高二(下)
- 《黄鹤楼送孟浩然之广陵》教案、说课、
- 2013年结构化学自测题 有答案版
- 2011西安世界园艺博览会游览解说词(附
- 窗口文明单位示范单位创建活动总结
- 2018满分超星尔雅就业课后练习期末答案
- 韶山市城市总体规划-基础资料
- 苏教版第三单元知识点归纳
- 第4章 曲轴模态分析
- 加大查办案件力度的思考
- 武汉CPC导轨介绍