| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:use “%g”无语了,那位好人帮忙看看In Reply To:use “%g” Posted by:Bark at 2008-02-20 23:55:50 #include<iostream>
using namespace std;
c++:
int main(void)
{
long long s[6];
for(int i=0;i<6;i++)
cin>>s[i];
while(s[0]||s[1]||s[2]||s[3]||s[4]||s[5])
{
cout<<1.0*(s[0]+s[1]+s[2]+s[3]+s[4]+s[5])/6<<endl;
for(int i=0;i<6;i++)
cin>>s[i];
}
return 0;
}
c
#include<stdio.h>
int main(void)
{
int s[6];
int i;
for( i=0;i<6;i++)
scanf("%d",s+i);
while(s[0]||s[1]||s[2]||s[3]||s[4]||s[5])
{
printf("%g\n",1.0*(s[0]+s[1]+s[2]+s[3]+s[4]+s[5])/6);
for( i=0;i<6;i++)
scanf("%d",s+i);
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator