CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 Windows编程 其他小程序

文件名称:uva10324

  • 所属分类:
  • 标签属性:
  • 上传时间:
    2015-05-10
  • 文件大小:
    1.34mb
  • 已下载:
    0次
  • 提 供 者:
  • 相关连接:
  • 下载说明:
    别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容来自于网络,使用问题请自行百度

uva 10324

題目說明 :



給你一連串僅包含0和1的字串(字串長度最大到1000000,字串從第0個字元開始),要請你回答我們在第i個和第j個字元之間

(包含第i個和第j個),是否所有的字元均相同(均為1或均為0)。如果均相同請回答Yes,否則請回答No。



Input



每筆測試資料的第一列為一個僅包含0和1的字串,下一列有1個整數n,代表對於上一列字串以下有n個問題。皆下來的 n 列,

每列有2個非負的整數,分別代表 i和 j。



Output



對每一列測試字串,請先輸出第幾個 Case。然後根據 n 個問題回答 Yes 或 No。



解法 :



1. 用 gets 讀入整行字串輸入,並計算長度



2. 先判斷第 0 個位置,為 0 則把 0 存入另一個整數陣列,為 1 則存 1



3. 用 for 迴圈把字串陣列轉換存到整數陣列,遇到字元 0 則值不變,遇到字元 1 則加 1



4. 欲判斷的i,j位置都為字元 0 ,且整數陣列i,j位置的值相同,代表有一連串 0 ,輸出 Yes



5. 欲判斷的i,j位置都為字元 1 ,且整數陣列i,j位置的值相減為i,j的差,代表有一連串 1 ,輸出 Yes



6. 其他情況輸出 No-uva 10324 Title Descr iption: give you a series of strings that contains only 0 and 1 (maximum string length to 1,000,000, character string starting 0), to ask you to answer our i-th and the j characters of the Inter (including the i-th and j-th), if all the characters are the same (both are 1 or 0). If you have the same answer Yes, or answer No. The first column of each test Input data string contains only 0 and 1, the next column has an integer n, representatives of the following string to the previous column has n problems. Are down n columns, each have two non-negative integer representing the i and j. Output test string for each column, please output the first of several Case. Then answer Yes or No. according to n a problem Solution: 1. read the entire line gets input string, and calculate the length of 2 to determine the position of the first 0, 0 put 0 into another integer array that is a deposit for loop 1 3. Use the string array to an integer array to convert stored encounter
(系统自动生成,下载前可以参看下载内容)

下载文件列表

uva10324/uva10324#a.in.txt
uva10324/uva10324#a.out.txt
uva10324/uva10324#b.in.txt
uva10324/uva10324#b.out.txt
uva10324/uva10324_1101105324.cpp
uva10324/uva10324_1101105324.exe
uva10324/uva10324_readme.txt
uva10324

相关说明

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

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com

浏览历史记录

关闭