摘要: 1.#includeint main(void){ int x,y; printf("Enter x:"); scanf("%d",&x); if (xint main(void){ int n,i,count; double grade,total; total = 0; count = 0; printf("Enter n:"); scanf("%d",&n); for(i=1;i=60){ count = count + 1; } } printf("Grade averag... 阅读全文
posted @ 2013-10-19 23:59 simple9495 阅读(87) 评论(0) 推荐(0) 编辑
摘要: #include#includeint main(void){ int n,i,power; double product; printf("Enter n:"); scanf("%d",&n); product=0; for(i=1;i<=n;i++){ power=pow(2,i); printf("%d",power); product=product+power; } printf("product=%.0f\n",product); return 0;} 阅读全文
posted @ 2013-10-19 23:54 simple9495 阅读(66) 评论(0) 推荐(0) 编辑
摘要: #include #include int main(void) { int year; double loan,money,my,rate; scanf("%Lf",&loan); scanf("%Lf",&rate); printf("year money\n"); for(year=5;year<=30;year++){ my=pow(1+rate,12*year); money=loan*rate*my/(my-1); printf("year=%d money=%.0f\n",yea 阅读全文
posted @ 2013-10-19 23:53 simple9495 阅读(73) 评论(0) 推荐(0) 编辑
摘要: #include int main(void) { int i,n; double x; double fact(int n); scanf ("%d", &n); x=0; for(i=0;i<=n;i++){ x=x+fact(i); } printf("x=%.0f\n",x); return 0;}double fact(int n) { int i; double y; y=1; for(i=1;i<=n;i++){ ... 阅读全文
posted @ 2013-10-19 23:52 simple9495 阅读(80) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int i,n,numerator,denominator,flag; double sum,item; printf("Enter n:"); scanf("%d",&n); numerator=1; denominator=1; sum=0; flag=1; for(i=1;i<=n;i++){ item=flag*(numerator*1.0/denominator); numerator=numerator+1; denominator... 阅读全文
posted @ 2013-10-19 23:46 simple9495 阅读(96) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int n,i; double x,y; y=1; printf("输入n,x:"); scanf("%d%Lf",&n,&x); for(i=1;i<=n;i++){ y=y*x; } printf("y=%Lf",y); return 0;} 阅读全文
posted @ 2013-10-19 23:45 simple9495 阅读(122) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int m,n; double i,y; y=1; printf("输入m,n的值:"); scanf("%d%d",&m,&n); for(i=m;i<=n;i++){ y=y+(i*i+1/i); } printf("y=%Lf",y); return 0;} 阅读全文
posted @ 2013-10-19 23:42 simple9495 阅读(94) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int num1,num2,a,b,c; double d,e; printf("输入num1,num2:"); scanf("%d%d",&num1,&num2); a=num1+num2; b=num1-num2; c=num1*num2; d=num1/num2; e=num1%num2; printf("输出和=%d差=%d积=%d商=%.2f余数=%.2f",a,b,c,d,e); return 0;} 阅读全文
posted @ 2013-10-19 23:37 simple9495 阅读(73) 评论(0) 推荐(0) 编辑