do while循环求和、数位颠倒
来源:互联网 发布:韦德上赛季场均数据 编辑:程序博客网 时间:2024/06/16 00:20
循环求和
#include<stdio.h>int main(){ double a,b,sum=0,ave=0,i=1; do{ scanf("%lf",&a); if(0 <= a && a<= 100) { sum += a; ave = sum / i; i ++; } }while(a != 999); printf("%.2lf %.2lf",sum,ave); return 0;}
数位颠倒
#include<stdio.h>int main(){ int num,len=0,temp=0; scanf("%d",&num); do{ temp=temp*10+num%10; num=num/10; len++; }while(num > 0); printf("%d %d",temp,len); return 0;}
阅读全文
0 0
- do while循环求和、数位颠倒
- 利用do-while循环求和
- 利用循环结构求和do while语句
- 第十周-1循环算法求和(do while用法)
- 第十周项目1-利用循环求和(do-while)
- 项目一 利用循环求和 do while 语句
- 第九周项目一利用循环求和(do while)
- 第九周项目1-利用循环求和(do while)
- while,do while循环
- 循环算法求和(for语句,while语句,do-while语句汇总!)
- js while / do while 循环
- while、do while、for循环
- swift while、do-while循环
- while,do while循环结构
- 循环:for、while、do-while
- 冒泡求和排序do while
- Do-While循环
- do while 循环
- nitoj_202_二分——将区间分为三个部分
- [python爬虫] 正则表达式使用技巧及爬取个人博客实例
- 洛谷 P2024 食物链
- 101 单调性及极值复习 型三:方程根
- Node.js 安装配置
- do while循环求和、数位颠倒
- 数据流程图,业务流程图,模块结构图
- python新浪微博爬虫
- LeetCode--406. Queue Reconstruction by Height
- 关于python用SAX解析XML
- Effective C++ 24. Declare non-member functions when type convesions should apply to all parameters
- Verilog学习笔记基本语法篇(四)·········块语句
- Kickstart Round G 2017 Problem C. Matrix Cutting
- java中length(),size()区别