24小时热门版块排行榜    

查看: 1395  |  回复: 14

我爱小虫子

新虫 (正式写手)

引用回帖:
9楼: Originally posted by sxu2009 at 2014-03-11 16:31:04
哦,是11条。...

大神 ,有空再帮忙看看这个吧
" target="_blank">http://muchong.com/bbs/viewthread.php?tid=7092755&fpage=1
11楼2014-03-11 18:36:17
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

我爱小虫子

新虫 (正式写手)

引用回帖:
4楼: Originally posted by oucfengfeng at 2014-03-11 00:16:25
你那9个大于60分的是不是都设成60多分了...

大神有空 再帮忙看下这个吧
http://muchong.com/bbs/viewthread.php?tid=7092755&fpage=1
感谢
12楼2014-03-11 18:39:05
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

我爱小虫子

新虫 (正式写手)

引用回帖:
2楼: Originally posted by libralibra at 2014-03-10 21:46:42
是三个要求同时满足吗?如果是,有9个>60,最后一个59,你的程序画出来的线是60,不满足(3)

大神有空再帮忙看下这个吧,谢谢啊
http://muchong.com/bbs/viewthread.php?tid=7092755&fpage=1
13楼2014-03-11 18:39:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

cgzhang_gg

铜虫 (著名写手)

按照要求分数线也有可能大于60分比如70 80 90
下面是我写的程序。
int main()
{
  const int n=10;
  int a[n];

int level(const int *, const int);
  for(int i=0; i < n; i++)
     cin >> a;
    cout << "level of score is:"
         <<level(a, n) << endl;
   return 0;
}

int level(const int *a, const int n)
{
  for(int j=10; j >= 0; j--)
    {
       int d = j*10;
       int cnt = 0;
      for(int i = 0; i < n; i++)
         if(a >= d) cnt++;
      if(d >  60 )
        {
          if(cnt >= (int)(0.6*n) && cnt < n)
            return d;
          if( cnt == n)  return 60;}
       else
          if(cnt >= (int)(0.6*n))
            return d;

    }
}
14楼2014-03-13 15:23:59
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

我爱小虫子

新虫 (正式写手)

引用回帖:
14楼: Originally posted by cgzhang_gg at 2014-03-13 15:23:59
按照要求分数线也有可能大于60分比如70 80 90
下面是我写的程序。
int main()
{
  const int n=10;
  int a;

int level(const int *, const int);
  for(int i=0; i < n; i++)
     cin >> a;
...

http://muchong.com/bbs/viewthread.php?tid=7092755&fpage=1
求大神说句话
15楼2014-03-13 18:35:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 我爱小虫子 的主题更新
信息提示
请填处理意见