1004 母牛的故事(递归) 摘要:#include<stdio.h>int f(int m){ if(m<5) { return m; } if(m>=5) { m=f(m-1)+f(m-3); ret…… 文章列表 2018年03月05日 0 点赞 0 评论 1033 浏览 评分:0.0
做题记录 摘要:1.<<setprecision(5)<< 与 <<fixed<<setprecision(4)<< 不等同2.在C/C++程序中打印变量名称#define VNAME(name) (#name) …… 文章列表 2018年03月12日 2 点赞 0 评论 780 浏览 评分:0.0
求Sn=1!+2!+3!+4!+5!+…+n!之值,其中n是一个数字(n不超过20)。 摘要:#include<stdio.h> int main() { int n, i; long int fact = 1, Sn = 0;//此处用long int或者long l…… 文章列表 2018年03月17日 4 点赞 0 评论 3451 浏览 评分:10.0
求以下三数的和,保留2位小数 1~a之和 1~b的平方和 1~c的倒数和 摘要:#include<stdio.h> #include <math.h> int main() { int a, b, c; long int sum = 0, powsum …… 文章列表 2018年03月17日 10 点赞 0 评论 2995 浏览 评分:9.9
打印出所有"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该本身。 例如:153是一个水仙花数,因为153=1^3+5^3+3^3。 摘要:#include<stdio.h> #include <math.h> int main() { int i; int sum; for(i = 100; i <=…… 文章列表 2018年03月17日 2 点赞 0 评论 2130 浏览 评分:9.9
最大公约数,最小公倍数 摘要:1: #include<stdio.h> int main() { int a, b, n; scanf("%d %d",&a, &b); n = a<b? a…… 文章列表 2018年03月17日 4 点赞 0 评论 1015 浏览 评分:0.0
一个数如果恰好等于不包含它本身所有因子之和,这个数就称为"完数"。 例如,6的因子为1、2、3,而6=1+2+3,因此6是"完数"。 编程序找出N之内的所有完数,并按下面格式输出其因子 摘要:#include <stdio.h> void main() { int i,j,sum; int N; scanf("%d", &N); for(i=…… 文章列表 2018年03月17日 26 点赞 0 评论 5078 浏览 评分:9.1
1005题咋一直答案错误,求大神指点 摘要:#include<stdio.h>main(){float c,F;printf("请输入一个华氏温度:");scanf("%f",&F);c=5*(F-32)/9;printf("c=%0.2f",…… 文章列表 2018年03月18日 0 点赞 2 评论 176 浏览 评分:0.0
打印几种图形的方法, 摘要:借鉴了http://blog.csdn.net/a1414345/article/details/51757435, https://bbs.csdn.net/topics/391035037 两位大…… 文章列表 2018年03月18日 1 点赞 0 评论 881 浏览 评分:0.0
C语言求最大公约数和最小公倍数 摘要:#include<stdio.h> int gcd(int x, int y) //求x,y的最大公约数 { if (!y) return x; return gcd(y,…… 文章列表 2018年03月20日 12 点赞 0 评论 3844 浏览 评分:0.0