#5517: 為什麼都過不了?


CSE911505 (小 弈 ★)


#include<iostream>
using namespace std;
int main()
{
  long long tot[1000]={0};
  int a;
  while(cin>>a)
  {
     int b=0;
     float c;
     for(int i=1;i<=a;i++)
     {
       cin>>tot[i];
       b=b+tot[i];
     }
     c=b/a;
     if(c<59)cout<<"yes"<<endl;
     else cout<<"no"<<endl;
  }

return 0;

}

 

 

到底錯在哪裡押?:(
誰來幫幫我~

#5520: Re:為什麼都過不了?


morris1028 (碼畜)


#include
using namespace std;
int main()
{
  long long tot[1000]={0};
  int a;
  while(cin>>a)
  {
     int b=0;
     float c;
     for(int i=1;i<=a;i++)
     {
       cin>>tot[i];
       b=b+tot[i];
     }
     c=b/a;
     if(c<59)cout<<"yes"<     else cout<<"no"<  }

return 0;

}

 

 

到底錯在哪裡押?:(
誰來幫幫我~

「老師說,如果平均大於 59 你就過關了」
ave>59 no
ave<=59 yes
#5553: Re:為什麼都過不了?


b546mmpm (James Lin)


#include
using namespace std;
int main()
{
  long long tot[1000]={0};
  int a;
  while(cin>>a)
  {
     int b=0;
     float c;
     for(int i=1;i<=a;i++)
     {
       cin>>tot[i];
       b=b+tot[i];
     }
     c=b/a;
     if(c<59)cout<<"yes"<     else cout<<"no"<  }

return 0;

}

 

 

到底錯在哪裡押?:(
誰來幫幫我~

如果你的a.b是整數 會遇到轉換的問題 會連c也是整數
#5554: Re:為什麼都過不了?


CSE911505 (小 弈 ★)


#include
using namespace std;
int main()
{
  long long tot[1000]={0};
  int a;
  while(cin>>a)
  {
     int b=0;
     float c;
     for(int i=1;i<=a;i++)
     {
       cin>>tot[i];
       b=b+tot[i];
     }
     c=b/a;
     if(c<59)cout<<"yes"<     else cout<<"no"<  }

return 0;

}

 

 

到底錯在哪裡押?:(
誰來幫幫我~

「老師說,如果平均大於 59 你就過關了」
ave>59 no
ave<=59 yes

 

 

  可是還是WA耶~

  怎麼會這樣:(