1.题目:通过编程实现,统计1~n有多少个9 提示:n通过参数传入
来源:互联网 发布:图片制作拼图软件 编辑:程序博客网 时间:2024/06/06 03:27
#include <stdio.h>void fun(int n){int i;int temp;int count = 0;int b;for(i = 1;i <= n;i++){temp = i;while(temp != 0){b=temp % 10;temp=temp / 10;if(b == 9){count++;}}}printf("The result is:%d\n",count);}int main(){int n;printf("Enter a number!\n");scanf("%d",&n);fun(n); return 0;}
0 0
- 1.题目:通过编程实现,统计1~n有多少个9 提示:n通过参数传入
- 通过编程实现,统计1~n有多少个9 提示:n通过参数传入
- 强化练习1:通过编程实现,分别统计0~n有多少个0~9 提示:n通过参数传入
- .通过编程实现,统计1~n有多少个9 (n通过参数传入)
- 初入C语言!整数算法练习1:通过编程实现,统计1~n有多少个9 ? 提示:n通过参数传入!
- 统计1~n有多少个9 ,n通过参数传入
- 通过编程实现,统计1~n有多少个9
- 通过编程实现,统计1~n有多少个9
- 通过编程实现,统计1~n有多少个9
- 通过编程实现,统计1~n有多少个9
- 题目:通过编程实现,统计 1~n 有多少个 9
- 统计1~n有多少个9
- 统计1~n有多少个9
- 统计1~n有多少个9
- 统计1~n有多少个9
- 题目3:统计0~n中有多少个9
- 题目4:统计0~n中有多少个0,1,2,3,4,5,6,7,8,9
- 整数算法训练01—统计1~n有多少个9
- 【项目管理和构建】——Maven简介(一)
- android如何监听粘贴板内容
- HTML学习小记2
- Android中控件的隐藏和显示
- github使用教程
- 1.题目:通过编程实现,统计1~n有多少个9 提示:n通过参数传入
- 【项目管理和构建】——Maven下载、安装和配置(二)
- CSS和HTML的四种结合方式
- 初探mongo之备份还原
- idea使用generator插件自动生成代码工具遇到的问题
- what's the difference between atime, ctime and mtime
- MAC电脑上最新版CornerStone上传静态库".a"文件失败问题解决
- CodeForces 337CQuiz(快速幂)
- 安装Oracle11g后无法使用其自带的SQLdeveloper