• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

wchenfeng

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 32 下一页

2022年4月12日

编写程序,读入3个双精度实数,求它们的平均值并按照如下个格式输出:保留4位小数,数据宽度为20、不足补0,输出正负号。

摘要: #includeint main(){ double a,b,c,sum; scanf("%lf%lf%lf",&a,&b,&c); sum=a+b+c; printf("%+020.4f\n",sum/3); return 0;} ... 阅读全文

posted @ 2022-04-12 20:03 王陈锋 阅读(184) 评论(0) 推荐(0)

编写程序实现从键盘输入三个整数,输出三个数中的最小数。(使用if关键字)

摘要: #includeint main(){ int x,y,z,min; scanf("%d%d%d",&x,&y,&z); min=x; if (min>y) min=y; else (min=x); if(min>z) min=z; printf("... 阅读全文

posted @ 2022-04-12 20:03 王陈锋 阅读(610) 评论(0) 推荐(0)

编写程序,输入一个整数,使用逻辑表达式计算该数“大于100或小于0”的结果并输出。

摘要: #includeint main(){int a,b;scanf("%d",&a);printf("%d",a>100||a<0);} 阅读全文

posted @ 2022-04-12 20:03 王陈锋 阅读(71) 评论(0) 推荐(0)

第三章顺序结构,输入3个小写字母,输出对应3个大写字母。小写字母转大写字母

摘要: #includeint main(){ char A,B,C; scanf("%c%c%c",&A,&B,&C); printf("%c%c%c\n",A+32,B+32,C+32); return 0;} 阅读全文

posted @ 2022-04-12 20:03 王陈锋 阅读(88) 评论(0) 推荐(0)

编写一个程序实现输入一个英文字母,如果是小写字母将其转换成大写输出,如果是大写字母则直接输出。

摘要: #includeint main(){ char b; scanf("%c",&b); if(b>='A'&&b96&&b<123) printf("%c\n",b-32); return 0;} 阅读全文

posted @ 2022-04-12 20:03 王陈锋 阅读(582) 评论(0) 推荐(0)

编写一个程序计算1-1/2+1/3-1/4+1/5-·······+1/9-1/10,计算其前10项的和。。

摘要: #include#includeint main(){double sum=0.0;int a;int i=1;while(i<11){ a=pow(-1,i+1); sum=sum+(a*(1.0/i)); i++;}pr... 阅读全文

posted @ 2022-04-12 20:03 王陈锋 阅读(228) 评论(0) 推荐(0)

打印直角三角形*

摘要: #includeint main(){ int i,j; for(i=1;i<=6;i++) { for(j=1;j<=i;j++) printf("*"); printf("\n"); }} 阅读全文

posted @ 2022-04-12 20:03 王陈锋 阅读(44) 评论(0) 推荐(0)

c语言基本减法

摘要: #includeint main(){ int a,b; scanf("%d%d",&a,&b); printf("a-b=%d",a-b); return 0;} 阅读全文

posted @ 2022-04-12 20:03 王陈锋 阅读(689) 评论(0) 推荐(0)

c语言中0.f例子

摘要: #includeint main(void){ double a=22222.22222; printf("a=%0.5f\n",a); return 0;} 阅读全文

posted @ 2022-04-12 20:03 王陈锋 阅读(188) 评论(0) 推荐(0)

c语言第一步hello world

摘要: #include int main(void){ printf("hello world"); return 0;} 阅读全文

posted @ 2022-04-12 20:03 王陈锋 阅读(36) 评论(0) 推荐(0)

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 32 下一页
 
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3