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

wchenfeng

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

公告

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

2022年4月12日

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

摘要: #includeint get_days_of_month(int year, int month){//补足函数 int days,flag; //printf("Please input year:"); // ... 阅读全文

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

第四章选择结构,从键盘输入任意一个数,判断是否为素数。

摘要: #include #include int is_prime(int n){ int a,b=1,k; k=sqrt (n); for(a=2;a<=k;a++) { if(n%a==0) { b=0; break ; } } if(n==... 阅读全文

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

(1)有一函数: 当x<1时,y=x 当1<=x<10时,y=2x-1 当x>=10时,y=3x-11 编写程序输入x,输出y的值

摘要: #includeint main(){ int x,y; scanf("%d",&x); if (x<1) y=x; else if (x<10) y=2*x-1; else y=3*x-11; printf("%d\n",y); return 0;} ... 阅读全文

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

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

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

posted @ 2022-04-12 20:04 王陈锋 阅读(147) 评论(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 王陈锋 阅读(157) 评论(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 王陈锋 阅读(23) 评论(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 王陈锋 阅读(27) 评论(0) 推荐(0)

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 王陈锋 阅读(51) 评论(0) 推荐(0)

回文2输入字符型进行判断

摘要: int huiwen(char *s){ char *p = s; while(*p) p++; p--; while(s<p) { if(*s != *p) return 0; s++; p--; ... 阅读全文

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

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