Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:use “%g”无语了,那位好人帮忙看看

Posted by me2002 at 2008-02-24 21:59:34 on Problem 3507
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator