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

wchenfeng

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

公告

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 32 下一页

2022年4月12日

编写一个程序实现输入垫圈的外直径和垫圈中心空洞的直径,求圆形垫圈的平面面积并输出。要求用浮点数,输出保留小数点后两位。

摘要: #includeint main(){ double r1,r2,s; double a_r1,a_r2; scanf("%lf",&r1); scanf("%lf",&r2); s=3.1415926*(r1*r1-r2*r2); printf("a... 阅读全文

posted @ 2022-04-12 20:03 王陈锋 阅读(117) 评论(0) 推荐(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 王陈锋 阅读(287) 评论(0) 推荐(0)

根据P257页例题3-18要求,编写一个链表结构,读取任意多个用户输入。之后将“2017001 81.0”和“2017005 85.0”“2017010 90.0”这三个数据从链表中删除,再将链表数据

摘要: #define _CRT_SECURE_NO_WARNINGS#include #include //malloc free等函数会使用到这头文件//定义链表的节点typedef struct node_s { long num; //学号 ... 阅读全文

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

根据年月日,判断已经多少天(4)

摘要: #includeint main(void){ int year,month,days=0,day,flag,sum=0; printf("Please input year:"); scanf("%d",&year); ... 阅读全文

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

(2)读取用户输入的任意多个整数,保存到malloc申请的内存空间中,打印数组,打印结束后要使用free释放内存。

摘要: #define _CRT_SECURE_NO_WARNINGS#include#include#includeint main()//主函数要写{ int i,n;//变量i,n要先定义才能使用。 int *p; scanf("%d",&n); p=(int*... 阅读全文

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

读取用户输入的任意多个整数,保存到malloc申请的内存空间中,打印数组,打印结束后要使用free释放内存。

摘要: #include#includeint main(){ int n,i;int *p; p=(int *)malloc(9*4); scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&p[i]); for(i=0;i<n;... 阅读全文

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

根据P257页例题13-8要求,编写一个链表结构,读取任意多个用户输入。之后删除学号为2017003的节点信息,并把删除后的链表打印出来

摘要: #define _CRT_SECURE_NO_WARNINGS#include #include #include typedef struct node_s { long num; float score; struct node_s* n... 阅读全文

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

根据年月日,判断已经多少天(3)

摘要: #includeint main(void){int year,month,days=0,day,flag,sum=0;int i=1;scanf("%d",&year);scanf("%d",&month);scanf("%d",&day);if(year%... 阅读全文

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

(第2种)编写一个程序,其有宏定义FUN(x),可用于计算x*2+x*2+x*2,实现从键盘输入一个实数a,输出FUN(a),FUN(a+1),FUN(a)*2的值。

摘要: #include#define FUN(x) x*2+x*2+x*2 //补充宏定义内容void main(void){ int a; scanf("%d", &a); printf("%d\n", FUN(a)); printf("... 阅读全文

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

编写一个结构体数组查找函数find,若找到则输出该结构体变量,否则输出未找到。

摘要: #include #include typedef struct { int num; char name[20]; int score;} stu;int find(stu list[], int list_len, char *find_... 阅读全文

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

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