文件名称:程设

  • 所属分类:
  • Windows编程
  • 资源属性:
  • 上传时间:
  • 2018-12-11
  • 文件大小:
  • 2kb
  • 下载次数:
  • 1次
  • 提 供 者:
  • 小***
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

1. 每条项链由N个随机排列的红色、白色和蓝色的珠子组成(3<=N<=350)

2. 参与者从项链的某处将它截断拉直;接着从一端向另外一端收集同颜色的珠子,直到碰到一个不同颜色的珠子为止;然后再从另外一端做同样的操作。(一端收集的珠子颜色可以不同于另一端的。)

3. 当遇到白色的珠子时,它既可以作为蓝色的珠子看待,也可以作为红色的珠子看待,由收集珠子时的需求决定。

4. 想办法找到一个截断项链的位置,能够尽量多地收集到同色的珠子,胜出者可免费获得珍珠项链一条。

现在请大家帮忙,编写一段程序,计算从某条项链中最多能够收集到多少个珠子,下面的例子展示了两条 N=29 时的项链:(1. Each necklace consists of N randomly arranged red, white and blue beads (3<=N<=350).



2. Participants cut and straighten the necklace somewhere; then collect the same color beads from one end to the other until they meet a different color bead; and then do the same thing from the other end. The color of beads collected at one end can be different from that collected at the other end. )



3. When encountering white beads, they can be viewed as either blue beads or red beads, depending on the needs of collecting beads.



4. Find a place to cut off the necklace and collect as many pearls of the same color as possible. The winner can get a pearl necklace free of charge.



Now please help me to write a program to calculate how many beads can be collected from a necklace. The following examples show two necklaces when N = 29:)
(系统自动生成,下载前可以参看下载内容)

下载文件列表

文件名大小更新时间
5.定情礼物.cpp 1314 2018-10-08
6.良乡足球场.cpp 958 2018-10-09
7.郭老师爱合并果子.cpp 2022 2018-10-14

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org