• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
唐旭敏
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 下一页
2013年10月7日
2-9
摘要: #includeint main(void){ int i,n; double product; printf("Enter n:"); scanf("%d",&n); product=1; for(i=1;i<=n;i++){ product=product*i; } printf("product=%.0f\n",product); return 0;} 阅读全文
posted @ 2013-10-07 10:18 唐旭敏 阅读(103) 评论(0) 推荐(0)
2-8
摘要: #includeint main(void){ int denominator,flag,i,n; double item,sum; printf("Enter n:"); scanf("%d",&n); flag=1; denominator=1; sum=0; for(i=1;i<=n;i++){ item=flag*1.0/denominator; sum=sum+item; flag=-flag; denominator=denominator+2; } printf("sum=%f\n",sum); retur 阅读全文
posted @ 2013-10-07 10:17 唐旭敏 阅读(94) 评论(0) 推荐(0)
2-7
摘要: #includeint main(void){ int i,n,sum; printf("Enter n:"); scanf("%d",&n); sum=0; for(i=1;i<=n;i++){ sum=sum+i; } printf("Sum of numbers from 1 to %d is %d\n",n,sum); return 0;} 阅读全文
posted @ 2013-10-07 10:15 唐旭敏 阅读(127) 评论(0) 推荐(0)
2-6
摘要: #includeint main(void){ int fahr,lower,upper; double celsius; printf("Enter lower:"); scanf("%d",&lower); printf("Enter upper:"); scanf("%d",&upper); printf("fahr celsius\n"); for(fahr=lower;fahr<=upper;fahr++){ celsius=(5.0/9.0)*(fahr-32) 阅读全文
posted @ 2013-10-07 10:14 唐旭敏 阅读(107) 评论(0) 推荐(0)
2-4
摘要: #includeint main(void){ double x,y; printf("Enter x(x>=0);\n"); scanf("%lf",&x); if(x<=15){ y=4*x/3; } else{ y=2.5*x-10.5; } printf("y=f(%f)=%.2f\n",x,y); return 0;} 阅读全文
posted @ 2013-10-07 10:11 唐旭敏 阅读(107) 评论(0) 推荐(0)
2-5
摘要: #include#includeint main(void){ int money,year; double rate,sum; printf("Enter money:"); scanf("%d",&money); printf("Enter year:"); scanf("%d",&year); printf("Enter rate:"); scanf("%lf",&rate); sum=money*pow(1+rate,year); printf 阅读全文
posted @ 2013-10-07 10:11 唐旭敏 阅读(79) 评论(0) 推荐(0)
2-3
摘要: #includeint main(void){ int celsius,fahr; fahr=100; celsius=5*(fahr-32)/9; printf("fahr=%d,celsius=%d\n",fahr,celsius); return 0;} 阅读全文
posted @ 2013-10-07 10:10 唐旭敏 阅读(125) 评论(0) 推荐(0)
2-2
摘要: #includeint main(void){ printf("Programming is fun.\n"); printf("And programming in C is even more fun!\n"); return 0;} 阅读全文
posted @ 2013-10-07 10:09 唐旭敏 阅读(90) 评论(0) 推荐(0)
2-1
摘要: #includeint main(void){ printf("Hello World!\n");return 0;} 阅读全文
posted @ 2013-10-07 10:07 唐旭敏 阅读(131) 评论(0) 推荐(0)
1-1
摘要: #includeint main(void){ int n; int factorial(int n); scanf("%d",&n); printf("%d\n",factorial(n)); return 0;}int factorial(int n){ int i,fact= 1; for(i=1;i<=n;i++) fact=fact*i; return fact;} 阅读全文
posted @ 2013-10-07 10:04 唐旭敏 阅读(127) 评论(0) 推荐(0)
上一页 1 2 3 4 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3