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






tyjd

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 2

2024年10月9日

以角拆分十元情况列举(for循环的反复嵌套使用)以及其跳出的两种方式
摘要: include <stdio.h> int main () { int x; int one,two,five; scanf ("%d",&x); for (one=0;one<x10;one++){ for(two=0;two<x10/2;two++){ for(five=0;five<x10/5 阅读全文
posted @ 2024-10-09 16:47 天厌九道 阅读(12) 评论(0) 推荐(0)
 
判断是否为素数
摘要: include <stdio.h> int main () { int n=1; int x; scanf("%d",&x); int biaozhi=1; for (n=2;n<x;n++){ if(x%n0 ){ biaozhi=0;此处可加break;} } if (biaozhi0)prin 阅读全文
posted @ 2024-10-09 15:40 天厌九道 阅读(26) 评论(0) 推荐(0)
 

2024年10月5日

猜数字
摘要: include <stdio.h> int main() { srand(time(0)); int number=rand()%100+1; int count=0; int a=0; printf("我已经想好了一个数字:"); do{ printf("试试猜出这个数字;"); scanf("% 阅读全文
posted @ 2024-10-05 12:33 天厌九道 阅读(26) 评论(0) 推荐(0)
 

2024年10月2日

九九乘法表(for函数,内层循环应用,制表换行符应用)
摘要: include <stdio.h> int main() { for(int x=1;x<=9;x++) { for(int y=1;y<=9;y++) { if(y<x)printf("");【引号内加空会导致倾斜】 else printf("%d%d=%2d\t",x,y,xy);【\t制表符用 阅读全文
posted @ 2024-10-02 19:59 天厌九道 阅读(32) 评论(0) 推荐(0)
 
上一页 1 2