Search found 4 matches

by winterflower
Sat Oct 06, 2007 6:03 pm
Forum: Volume 113 (11300-11399)
Topic: 11309 - Counting Chaos
Replies: 18
Views: 10288

AC now , thanks for your help.
by winterflower
Sat Oct 06, 2007 5:11 pm
Forum: Volume 113 (11300-11399)
Topic: 11309 - Counting Chaos
Replies: 18
Views: 10288

11309 - Counting Chaos

Any tricky test case for this problem?

Thanks in advance!
by winterflower
Mon Mar 06, 2006 9:14 am
Forum: C++
Topic: compile error. help...
Replies: 4
Views: 2658

Thanks a lot!
I got AC now by adding the declaration of the ''int i''.
But I still don't know why this correct code got such result in VC++.
The former code I posted works well in it. :o

--------------------Configuration: aver - Win32 Debug--------------------
Compiling...
aver.cpp
C:\Mycpp\aver ...
by winterflower
Mon Mar 06, 2006 7:25 am
Forum: C++
Topic: compile error. help...
Replies: 4
Views: 2658

compile error. help...


#include<iostream>
#include<iomanip>
using namespace std;
void main(){
int n;
cin>>n;
int k;
double *p;
while(n-- > 0){
cin>>k;
p = new double[k];
double sum = 0;
for(int i=0;i<k;i++){
cin>>p ;
sum += p ;
}
int c = 0;
double ave = sum/(double)k;
for(i=0;i<k;i++){
if(p > ave) c ...

Go to advanced search