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

wchenfeng

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

公告

1 2 3 4 5 ··· 32 下一页

2022年4月12日

输入一串数字,逆向,反向输出数字

摘要: #include void main(){int a,ret=0,t;scanf("%d",&a);while(a>0){ t=a%10; ret=t;printf("%d",ret); a=a/10; }} 阅读全文

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

信函的重量不超过100g时,每20g付邮资80分,编写程序输入信函的重量,若不超过100g则输出应付的邮资。

摘要: #includeint main() { int x,y;scanf("%d",&x);y=x/10;switch(y){ case 0:case 1:printf("80");break;case 2:case 3:printf("160");brea... 阅读全文

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

冒泡排序法(1)从小到大排序,输入5个数

摘要: 冒泡排序法1 例子:2 15 32 54 65 #define n 32#includeint main(void){ int i,j,t; int a[n]; for(i=0;ia[j+1]) { t=a[j]; a[j]=a[j... 阅读全文

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

输出字符串中的大写字母

摘要: 输出字符串中的大写字母 #includeint main(){ char a[100]; char *p; p=gets(a); while(*p) { if(*p>='A'&&*p... 阅读全文

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

输入十个数,求最大,最小值,平均数,和。

摘要: 输入十个数,求最大,最小值,平均数,和。 #includeint main(){ int a[10],i,sum=0,max,min; float average; for(i=0;ia[i]) min=a[i]... 阅读全文

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

Hanoi塔问题

摘要: Hanoi塔问题 #includeint move(int n,int x,int y,int z){ if(n==1) printf("%c-->%c\n",x,z); else { move(n-1,x,z,y); printf("%c-->%c\n... 阅读全文

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

使用递归,判断回文

摘要: 使用递归,判断回文 #include #includeint main(){ int begin ,end; char s[100]; gets(s); begin=0;end=strlen(s)-1; printf("%d",huiwe... 阅读全文

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

将十进制转换二进制,使用递归

摘要: 将十进制转换二进制,使用递归 #includeint main(){ int b; scanf("%d",&b); er(b);}int er(int n){ if(n>1) er(n/2); printf("%d",n%2);} ... 阅读全文

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

冒泡法与递归解决绝对值排序-99, 98, 102, -101, 100

摘要: 冒泡法与递归解决绝对值排序-99, 98, 102, -101, 100 #include #include void swap(int* a, int* b) { int tmp; tmp = *a; *a=*b; *b=tmp;}void printf_l... 阅读全文

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

利用递归求最大公因子

摘要: 利用递归求最大公因子 #includeint gys(int a,int b){ int c; if(a<b) { c=a;a=b;b=c; } if(b!=0) return gys(b,a%b); ... 阅读全文

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

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