Modify the average program to promote for intergers repeatedly.stop when a nagetive number is entere
#include<stdio.h>
int main(void)
{
intcount ,sum,aninterger;
printf("enterthe interger anf terminute with negtive number\n");
count=0;
sum=0;
printf("enternumber %d:\n",count+1);
scanf("%d",&aninterger);
while(aninterger>&&aninterger!='\n')
{
sum+=aninterger;
count++;
printf("enter number%d:\n",count+1);
scanf("%d",&aninterger);
}
if(count!=0)
printf("theaverage is %f\n",sum/(double)count);
else
printf("youshuru 了一个wronginterger\n");
return0;
}
Modify the average program to promote for intergers repeatedly.stop when a nagetive number is entere的更多相关文章
- Game Engine Architecture 2
[Game Engine Architecture 2] 1.endian swap 函数 floating-point endian-swapping:将浮点指针reinterpert_cast 成 ...
- Global Average Pooling Layers for Object Localization
For image classification tasks, a common choice for convolutional neural network (CNN) architecture ...
- Application binary interface and method of interfacing binary application program to digital computer
An application binary interface includes linkage structures for interfacing a binary application pro ...
- C语言代写
MTRX1702 - C ProgrammingAssignment 2This assignment requires you to design and build a program that ...
- Monitoring and Tuning the Linux Networking Stack: Receiving Data
http://blog.packagecloud.io/eng/2016/06/22/monitoring-tuning-linux-networking-stack-receiving-data/ ...
- DTrace to Troubleshoot Java Native Memory Problems
How to Use DTrace to Troubleshoot Java Native Memory Problems on Oracle Solaris 11 Hands-On Labs of ...
- 计算机视觉code与软件
Research Code A rational methodology for lossy compression - REWIC is a software-based implementatio ...
- Code Complete阅读笔记(三)
2015-05-26 628 Code-Tuning Techniques ——Even though a particular technique generally represen ...
- 美国政府关于Google公司2013年度的财务报表红头文件
请管理员移至新闻版块,谢谢! 来源:http://www.sec.gov/ 财务报表下载↓ 此文仅作参考分析. 10-K 1 goog2013123110-k.htm FORM 10-K UNIT ...
随机推荐
- Oracle系列之索引
涉及到表的处理请参看原表结构与数据 Oracle建表插数据等等 Oracle索引.权限 介绍 为什么添加了索引后,会加快查询速度呢? 索引是用于加速数据存取的数据对象.合理的使用索引可以大大降低i/ ...
- Nginx+Keepalived 做负载均衡器
1.安装 keepalived 1 2 3 4 5 6 7 8 9 tar zxvf keepalived-XXXX.tar.gz ./configure --prefix=/usr/local/ ...
- hdu4734F(x)(dp)
http://acm.hdu.edu.cn/showproblem.php?pid=4734 各种不细心啊 居然算的所有和最大值会小于1024... 第二次做数位DP 不是太熟 #include ...
- .NET程序内,访问私有或者保护成员的技巧
如果是C++,我们可以计算对象内成员的位置,然后偏移指针以访问类型的所有非公开成员.但是.NET对象完全受GC管理,地址根本无法得到,并且也无法通过指针调用方法. 当然... 这是一种很不值得推荐的技 ...
- 【转】CString类型互转 int
CString类型互转 int 原文网址:http://www.cnitblog.com/Hali/archive/2009/06/25/59632.html CString类型的转换成int 将字 ...
- POJ 1511 Invitation Cards dij
分析:正向加边,反向加边,然后两遍dij #include<cstdio> #include<cstring> #include<queue> #include&l ...
- 跟我学机器视觉-HALCON学习例程中文详解-IC引脚测量
跟我学机器视觉-HALCON学习例程中文详解-IC引脚测量 Lead Measurement: Example for the application of the measure object in ...
- Cogs 97. [NOIP2007] 树网的核 Floyd
题目: http://cojs.tk/cogs/problem/problem.php?pid=97 97. [NOIP2007] 树网的核 ★☆ 输入文件:core.in 输出文件:core ...
- cloudstack安装篇1-linux命令修改IP信息
方式一: ifconfig eth0 192.168.1.18 netmask 255.255.255.0 说明:该种方式可以使改变即时生效,重启后会恢复为原来的IP 方式二: vi ...
- POJ1276 - Cash Machine(多重背包)
题目大意 给定一个容量为M的背包以及n种物品,每种物品有一个体积和数量,要求你用这些物品尽量的装满背包 题解 就是多重背包~~~~用二进制优化了一下,就是把每种物品的数量cnt拆成由几个数组成,1,2 ...