whats wrong in my code?i got wrong answer
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
bool cmp(const pair<int, int> &p1, const pair<int, int> &p2)
{
return p1.second < p2.second;
}
int main()
{
string n;
int ascii[1001],i,j,m,l,temp,f=1;
map ...
Search found 2 matches
- Thu Sep 25, 2014 3:00 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10062 - Tell me the frequencies!
- Replies: 235
- Views: 69515
- Wed Sep 17, 2014 8:34 am
- Forum: Volume 101 (10100-10199)
- Topic: 10137 - The Trip
- Replies: 159
- Views: 70208
10137 - The Trip
i got wrong answer.What's problem on my below code?
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int i;
long n;
double sum,c[1001],avg,pay,receive;
while(scanf("%ld",&n)>0)
{
sum=0.0;
pay,receive=0.0;
for(i=0;i<n;i++)
{
cin>>c ;
sum+=c ;
}
avg=(long)(sum/n ...
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int i;
long n;
double sum,c[1001],avg,pay,receive;
while(scanf("%ld",&n)>0)
{
sum=0.0;
pay,receive=0.0;
for(i=0;i<n;i++)
{
cin>>c ;
sum+=c ;
}
avg=(long)(sum/n ...