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

wchenfeng

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

公告

上一页 1 2 3 4 5 6 7 ··· 32 下一页

2022年4月12日

extern外部函数导入使用11-8例题

摘要: file1 #includeextern float function(float a);int main(){ printf("reseult=%f\n",function(3.0));} file 2 float function(float a){ re... 阅读全文

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

11-7全局变量作用域测试

摘要: #includeint a,b;int f1(){ int a=10; printf("i am in f1 a=%d b=%d\n",a,b);}float c,d;int f2(){ float c=100.0; printf("i am in f2 a=... 阅读全文

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

11-7全局变量作用域测试(2)(函数调用)

摘要: #includeint a,b;float c,d;int main(){ int f2(); int f1(); a=1; b=2; c=50.0; d=60.0; printf("i am in main1 a=%d b=%d c=%f d=%f\n",... 阅读全文

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

编写程序,解决鸡兔同笼问题:一个笼子里关着鸡和兔子。问笼中各有多少只鸡和兔?

摘要: #includeint main(){ int a,b,x; puts("输入头数量:");scanf("%d",&a); puts("输入脚数量:");scanf("%d",&b); x=-(b-a*4)/2; printf("鸡:%d 兔子:%d",x,... 阅读全文

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

输入几个一串字符串,找出最小的字符串。

摘要: #include#include#define N 20#define M 81int getstr(char p[][M]){ char t[M],n=0; /*printf("enter string a empty string to end\n"); ... 阅读全文

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

编写程序实现从键盘输入一个整数,判断该数是奇数还是偶数并输出。 例如:输入13,则应输出odd。(odd奇数,even偶数)

摘要: #includeint main(){int a;scanf("%d",&a);if (a%2==0){printf("even");}else{printf("odd");}return 0;} 阅读全文

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

第三章顺序结构,实现输入一个华氏温度f,要求输出摄氏温度c,公式f=9/5*c+32,要求输出结果保留到小数点后2位。

摘要: #includeint main(){ float f,c; scanf("%f",&f); c = (f - 32)*5/9; printf("%.2f",c); return 0;} 阅读全文

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

编写一个字符串比较函数my_strcmp,若相等输出0,否则输出两个字符串中第一个不相同字符的ASCII码差值。

摘要: #define _CRT_SECURE_NO_WARNINGS#include #include #include int my_strcmp(char a[], char b[]){ int i,x; char *p1=a,*p2=b; wh... 阅读全文

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

将字符串类型转换成整型

摘要: #includeint main(){char a[20],*p=a;long x;scanf("%s",a);while(*p!='\0'){ x=(*p-48);p++;printf("%ld",x);}} 阅读全文

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

编写字符串类型输入,进行冒泡排序

摘要: #include#include#define n 5void sort(char *p[n],int k){ int i, j; char* temp;//定以以个空指针方便交换0 for (i = 0;i 0)//注意函数里面的参数的是字符串的地址 ... 阅读全文

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

上一页 1 2 3 4 5 6 7 ··· 32 下一页
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3