• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
大佬和我做朋友吧
博客园    首页    新随笔    联系   管理    订阅  订阅
2022年1月18日
写一个函数,比较三个数,然后求出最大值
摘要: #include <stdio.h> int max(int a, int b, int c) { int d = a > b ? a : b; d = d > c ? d : c; return d; } int main() { int x, y, z; scanf("%d%d%d", &x, 阅读全文
posted @ 2022-01-18 14:04 想和大佬做朋友 阅读(266) 评论(0) 推荐(0)
写一个求一个数的n次方的函数
摘要: 用函数喽 #include <stdio.h> int n_pow(int x, int n) { int i, t = 1; for(i = 0; i < n; i++) { t = t * x; } return t; } int main() { int a = n_pow(2, 3); pr 阅读全文
posted @ 2022-01-18 13:51 想和大佬做朋友 阅读(151) 评论(0) 推荐(0)
判断一个字符串中是否存在某个子串
摘要: // string1 "ftgfdajkfdasklfdsa" // string2 "dajk" #include <stdio.h> #include <string.h> int main() { int i, j; char a[] = "ftgfdajkfdaskdajklfdsa"; c 阅读全文
posted @ 2022-01-18 13:44 想和大佬做朋友 阅读(91) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3