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

wchenfeng

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

公告

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 32 下一页

2022年4月12日

(2种)编写一个函数funchar(char *a,char *b,char *c)实现如下功能:将在第一个字符串中出现的但在第二个字符串未出现的字符放在第三个字符串中,函数返回第三个字符串的长度。

摘要: #include#includetypedef struct zimu{ char a[32]; char b[32]; char c[32];}str;int main(){ int i,k=0,j,t=0; str x={0}; scanf("%s",&x... 阅读全文

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

编写一个程序,其有宏定义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*2int main(){ int a,b,c; scanf("%d",&a); b=a+1;c=FUN(a); printf("%d\n",FUN(a)); printf("%d\n",FUN(... 阅读全文

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

输入学号,名字,年龄进行排序。(可控人数)(结构体)利用年龄进行排序。

摘要: #include #include #include #define N 5typedef struct student{ char num[10]; char name[20]; int age;}stu;void swap_student(stu *... 阅读全文

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

结构类型计算字节sizeof,人工,编译器,指针。

摘要: 编译器算出来的字节数比人工算出来的多,编译器考虑到字节对齐的原因,要求4字节对齐,读取效率加快。 人工是按1字节进行对齐。 人工的 #include#pragma pack (1)struct student{ char name... 阅读全文

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

全班 N 个学生,每个学生有学号、姓名、年龄,需要按照年龄进行排序.

摘要: #include #include #include #define N 5typedef struct student { char num[10]; char name[20]; int age;}stud;void swap_student(str... 阅读全文

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

定义一个学生结构体,用scanf读取学号、姓名、年龄信息对其赋值,之后再输出出来。

摘要: #includetypedef struct student{ char num[10],name[20]; int age;}stud;int main(int argc,char* argv[]){ int i=0; stud stu[2]; scanf(... 阅读全文

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

编字符串排列函数sort,实现从键盘输入5个字符串(每个字符串长度小于30),其ascii码从小到大排列输出,冒泡法。

摘要: #include#include#define M 5#define N 20void swap(char a[], char b[]) { char st[N]; strcpy(st, a); strcpy(a, b); strcpy(b,... 阅读全文

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

编写程序实现输入一个不超过100的十进制正整数,输出与其相等的二进制形式

摘要: #include int main(void){ int i,j; int n; int a[32]; scanf("%d",&n); for(i=0;n>0;i++) { a[i]=n%2; n/=2; } for(j=i-1;j>=0;j--)... 阅读全文

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

输入5个数字,进行从小到大排序(2)运用char类型

摘要: #define n 32#includeint main(void){ int i,j,t; char a[n]; for(i=0;ia[j+1]) { t=a[j]; a[j]=a[j+1]; a[j+1]=t; }... 阅读全文

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

文件,本程序用于创造一个文件,或者搜索一个文件,然后输入字符串到其中,并进行读取

摘要: #include#include#include#define nu NULLint main(){ FILE *fp;char string[128]; char ch;char a[128],b[128]; printf("本程序用于创造一个文件,或者搜索... 阅读全文

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

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 32 下一页
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3