日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

CSCI1540代寫、代做C++設計編程
CSCI1540代寫、代做C++設計編程

時間:2024-10-16  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



CSCI1540 Fundamental Computing with C++, Fall 2024/25 
Department of Computer Science and Engineering, The Chinese University of Hong Kong 
Copyright © 2024 CSE, CUHK Page 1 of 2 
Due: 23:59, Thu 17 Oct 2024 File name: kaprekar.cpp Full marks: 100 
Introduction 
The objective of this assignment is to master the use of selective and nested repetitive control flow. 
You will write nested loops to look for Kaprekar numbers. 
A Kaprekar number is a positive integer    if the digits of the square   
2
 can be split into two parts 
that add up to   , where the part formed from the low-order (rightmost) digits of   
2
 must be nonzero
 (although leading zeroes are allowed in the part). For example, 45 is a Kaprekar number, 
because 45
2 = 2025 can be split into two parts 20 and 25, with 20 + 25 = 45. As another example, 
999 is also a Kaprekar number, because 999
2 = 998001 and 998 + 001 = 999. (Note the loworder
 part 001 includes leading zeroes.) However, 31 is not a Kaprekar number, because all three 
possible splits of 31
2 = 961 are no good (96 + 1 ≠ 31, 9 + 61 ≠ 31, and 0 + 961 ≠ 31). 
Program Specification 
The program shall ask for two user inputs    and   . They are assumed to be always integers. You are 
required to use the data type long long instead of int for all integer variables in this assignment, 
because a square can easily go overflow with (that is, larger than the upper bound of) the int type. 
1. The program first prompts the user to enter an integer   . When    is not positive, you shall 
display a warning message and ask for another input, until    is positive. Your program shall look 
for Kaprekar number(s) greater than or equal to   . 
2. Then prompt the user to enter how many Kaprekar numbers the user is looking for. When this 
input    is not positive, display a warning message and ask for another input, until    is positive. 
3. After validating inputs    and   , repeatedly test   ,    + 1,    + 2,    + 3, … to check whether it is a 
Kaprekar number. If so, print out the square and the split of the two parts. (See the upcoming 
Sample Runs section for the printing format.) Repeat these checks until    Kaprekar numbers are 
found and printed. Then program execution ends. 
➢ To check whether a number    is a Kaprekar number, you progressively check all possible 
splits of   
2
. E.g., let    = 345 and hence   
2 = 11**25. The first split to check is 11**2 and 
5; the next split is 11** and 25; the next split is 119 and 025; and so on. 
Note: In this assignment, you are not allowed to: (1) use any functions in the <cmath> library, (2) 
write any functions other than main(), and (3) use any arrays/vectors (which are not yet taught). 
Sample Runs 
In the following sample runs, the blue text is user input and the other text is the program printout. 
You can try the provided sample program for other input. Your program output should be exactly the 
same as the sample program (same text, symbols, letter case, spacings, etc.). Note that there is a 
space after the ‘:’ and ‘?’ in the program printout. CSCI1540 Fundamental Computing with C++, Fall 2024/25 
Department of Computer Science and Engineering, The Chinese University of Hong Kong 
Copyright © 2024 CSE, CUHK Page 2 of 2 
Enter an integer: 40↵ 
How many Kaprekar numbers? 3↵ 
45^2 = 2025 
20 + 25 = 45 
55^2 = 3025 
30 + 25 = 55 
99^2 = 9801 
98 + 1 = 99 
 
Enter an integer: -23↵ 
Input must be +ve! Enter again. 
Enter an integer: -1↵ 
Input must be +ve! Enter again. 
Enter an integer: 0↵ 
Input must be +ve! Enter again. 
Enter an integer: 200↵ 
How many Kaprekar numbers? 0↵ 
Input must be +ve! Enter again. 
How many Kaprekar numbers? 0↵ 
Input must be +ve! Enter again. 
How many Kaprekar numbers? -777↵ 
Input must be +ve! Enter again. 
How many Kaprekar numbers? 5↵ 
297^2 = 88209 
88 + 209 = 297 
703^2 = 494209 
494 + 209 = 703 
999^2 = 998001 
998 + 1 = 999 
2223^2 = 4941729 
494 + 1729 = 2223 
2728^2 = 7441984 
744 + 1984 = 2728 
Submission and Marking 
• Your program file name shall be kaprekar.cpp. Submit the file in Blackboard 
(https://blackboard.cuhk.edu.hk/). 
• Insert your name, student ID, and e-mail as comments at the beginning of your source file. 
• You can submit your assignment multiple times. Only the latest submission counts. 
• Your program should be free of compilation errors and warnings. 
• Your program should include suitable comments as documentation. 
• Do NOT share your work to others and do NOT plagiarize. Both senders and plagiarists shall be 
penalized. 

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp






 

掃一掃在手機打開當前頁
  • 上一篇:代寫FIT2107、代做Python設計編程
  • 下一篇:FIT2102代做、代寫Java/Python設計程序
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 trae 豆包網頁版入口 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

      <em id="rw4ev"></em>

        <tr id="rw4ev"></tr>

        <nav id="rw4ev"></nav>
        <strike id="rw4ev"><pre id="rw4ev"></pre></strike>
        麻豆国产精品777777在线| 91久久精品国产91久久性色tv| 欧美视频四区| 亚洲精品国精品久久99热| 日韩午夜剧场| 久久国产加勒比精品无码| 国内一区二区在线视频观看| 国产麻豆精品久久一二三| 亚洲欧美日韩区| 欧美日韩视频在线第一区| 午夜在线观看欧美| 欧美成人综合一区| 欧美日韩大片| 国产亚洲福利| 亚洲自拍另类| 国产精品一区二区你懂的| 樱桃成人精品视频在线播放| 99精品福利视频| 欧美在线观看一区二区三区| 日韩一级大片| 亚洲人体大胆视频| 狠狠色丁香婷婷综合影院| 最新高清无码专区| 在线国产精品一区| 欧美日韩伦理在线| 欧美日韩国产在线播放| 一区二区在线看| 久久国产天堂福利天堂| 欧美中文字幕在线| 国产视频一区免费看| 国产精品稀缺呦系列在线| 久久综合九色| 国产精品久久久久久五月尺| 国产精品视频一二| 国产精品女同互慰在线看| 欧美日韩中文字幕在线视频| 亚洲国产mv| 亚洲国产高清aⅴ视频| 欧美激情精品久久久久久免费印度| 欧美大秀在线观看| 国产精品www.| 国产欧美日韩精品a在线观看| 亚洲国内在线| 欧美精品日韩综合在线| 亚洲一区自拍| 久久精品一区蜜桃臀影院| 欧美日韩国产探花| 国产免费成人| 狼狼综合久久久久综合网| 欧美有码在线视频| 亚洲精品在线观看视频| 一区二区三区视频在线观看| 欧美日本亚洲韩国国产| 国产精品伦一区| 海角社区69精品视频| 国产精品视频yy9099| 国产日韩欧美在线播放| 一区二区三区欧美激情| 亚洲区在线播放| 欧美高清成人| 欧美丰满少妇xxxbbb| 欧美吻胸吃奶大尺度电影| 最新国产の精品合集bt伙计| 欧美午夜久久久| 免费观看日韩| 久久综合久久88| 亚洲欧美在线高清| 国产精品一区二区男女羞羞无遮挡| 欧美一区二粉嫩精品国产一线天| 欧美另类亚洲| 久久久久久久综合| 日韩视频永久免费观看| 欧美久久婷婷综合色| 国产丝袜一区二区三区| 国产私拍一区| 99re6这里只有精品视频在线观看| 亚洲欧美自拍偷拍| 久久免费视频一区| 激情国产一区| 噜噜爱69成人精品| 日韩一级欧洲| 亚洲国产视频直播| 久久婷婷人人澡人人喊人人爽| 国产精品第三页| 国产精品女同互慰在线看| 国产中文一区| 国产精品乱码一区二区三区| 欧美福利电影在线观看| 美脚丝袜一区二区三区在线观看| 欧美日韩成人在线视频| 亚洲国产精品成人一区二区| 欧美性色综合| 欧美激情精品久久久久| 经典三级久久| 欧美人与性动交cc0o| 国产精品入口66mio| 亚洲人成绝费网站色www| 国产精品一区免费视频| 亚洲大胆美女视频| 国产精品电影观看| 久久精精品视频| 午夜精品成人在线视频| 黄色影院成人| 久久精品国产亚洲精品| 日韩一级黄色片| 国产综合激情| 亚洲图色在线| 一本久道久久综合婷婷鲸鱼| 亚洲一区久久| 国产精品自在欧美一区| 欧美精品九九99久久| 国产精品麻豆成人av电影艾秋| 久久成人人人人精品欧| 欧美日韩ab片| 在线免费精品视频| 久久国产黑丝| 一色屋精品视频在线观看网站| 欧美国产一区视频在线观看| 欧美日韩中文字幕日韩欧美| 午夜老司机精品| 新狼窝色av性久久久久久| 欧美激情欧美激情在线五月| 日韩视频在线免费| 伊人成年综合电影网| 欧美成人激情视频免费观看| 国产精品亚洲第一区在线暖暖韩国| 国产精品极品美女粉嫩高清在线| 99国产精品视频免费观看一公开| 中文在线不卡| 亚洲免费福利视频| 亚洲国产精选| 久久精品主播| 牛人盗摄一区二区三区视频| 黄色成人片子| 欧美日韩免费高清| 久久人人九九| 欧美一进一出视频| 国产欧美综合在线| 久久一区中文字幕| 欧美激情一区二区三区不卡| 亚洲免费观看在线观看| 香蕉国产精品偷在线观看不卡| 国产精品有限公司| 欧美日韩福利在线观看| 亚洲二区视频在线| 欧美不卡一卡二卡免费版| 一本大道av伊人久久综合| 99精品热6080yy久久| 欧美成人午夜激情视频| 亚洲精品在线三区| 久久综合久久久久88| 久久九九国产精品怡红院| 亚洲一区二区三区免费在线观看| 国产精品私拍pans大尺度在线| 亚洲一区免费视频| 国产日韩精品一区二区| 欧美二区在线看| 葵司免费一区二区三区四区五区| 久久精品人人做人人综合| 蜜桃精品一区二区三区| 亚洲一区二区在线| 麻豆成人在线播放| 亚洲无吗在线| 欧美日韩午夜在线|