日韩精品一区二区三区高清_久久国产热这里只有精品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設計程序
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 酒店vi設計 deepseek 幣安下載 AI生圖 AI寫作 aippt AI生成PPT 阿里商辦

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

    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>
        国产精品国产三级国产aⅴ浪潮| 黄色成人精品网站| 欧美成人三级在线| 欧美 日韩 国产精品免费观看| 亚洲精品欧洲精品| 欧美人与性禽动交情品| 国产精品不卡在线| 伊人天天综合| 亚洲第一精品久久忘忧草社区| 亚洲激情视频在线播放| 欧美成人精精品一区二区频| 在线观看欧美日韩| 欧美日韩精品一区视频| 在线视频观看日韩| 亚洲欧美大片| 狠狠色狠狠色综合日日小说| 国产亚洲欧美激情| 国产在线高清精品| 先锋影音国产一区| 免费试看一区| 久久狠狠久久综合桃花| 久久精品99国产精品| 亚洲免费视频在线观看| 欧美激情a∨在线视频播放| 欧美精选午夜久久久乱码6080| 午夜一区二区三区在线观看| 欧美人与性动交α欧美精品济南到| 久热精品视频在线观看| 精品动漫av| 亚洲欧美精品伊人久久| 亚洲国产成人av| 久久一区亚洲| 久久精品2019中文字幕| 国产综合香蕉五月婷在线| 欧美在线日韩在线| 欧美与欧洲交xxxx免费观看| 一区二区激情小说| 狠狠久久五月精品中文字幕| 在线看无码的免费网站| 免费人成网站在线观看欧美高清| 国产精品视频大全| 性欧美在线看片a免费观看| 亚洲欧美中文日韩v在线观看| 免费日韩av片| 一区二区欧美日韩| 久久精品中文字幕免费mv| 美女在线一区二区| 久久综合中文| 国外成人在线视频| 日韩午夜激情| 亚洲免费成人| 国产精品日本欧美一区二区三区| 亚洲精品三级| 国产精品综合久久久| 在线观看亚洲视频啊啊啊啊| 亚洲欧美一区二区激情| 在线不卡a资源高清| 国产日产亚洲精品| 99热精品在线| 欧美一区三区三区高中清蜜桃| 欧美精品在线网站| 亚洲欧美日韩综合aⅴ视频| 午夜亚洲激情| 欧美电影在线观看完整版| 中文日韩在线| 黄色工厂这里只有精品| 亚洲免费一在线| 亚洲精品一区二区三区99| 亚洲免费电影在线观看| 欧美成人国产va精品日本一级| 亚洲国产成人av| 国产女主播一区| 美女日韩在线中文字幕| 中文在线资源观看视频网站免费不卡| 欧美视频在线免费| 欧美视频在线观看一区| 欧美日韩中文字幕| 国产精品成人国产乱一区| 精品999久久久| 欧美精品亚洲二区| 国产日韩欧美| 欧美一区二区三区久久精品| 国产精品久久久久久久久久免费看| 精品91视频| 国产精品va在线播放我和闺蜜| 久久综合狠狠综合久久综合88| 国产精品午夜av在线| 欧美色图一区二区三区| 亚洲高清视频的网址| 欧美午夜片在线免费观看| 国产精品女人网站| 国产精品一区久久| 亚洲一区二区三区高清不卡| 亚洲一区二区三区中文字幕在线| 国产视频在线观看一区| 欧美gay视频激情| 欧美激情综合在线| 国产视频观看一区| 久久久午夜精品| 久久国产66| 欧美日韩国产综合新一区| 欧美日本韩国在线| 欧美女主播在线| 日韩视频不卡中文| 国产欧美精品在线| 欧美第十八页| 国产精品一区二区男女羞羞无遮挡| 国产香蕉97碰碰久久人人| 国产一区二区精品在线观看| 影音先锋中文字幕一区二区| 欧美日韩一区视频| 免费成人毛片| 欧美劲爆第一页| 日韩视频国产视频| 午夜亚洲伦理| 91久久精品国产| 欧美午夜精品| 欧美福利影院| 国产精品免费在线| 亚洲国产精品嫩草影院| 99热免费精品在线观看| 国产精品久久9| 欧美区视频在线观看| 国产一区二区三区在线播放免费观看| 国内精品国语自产拍在线观看| 亚洲在线视频免费观看| 国产日韩精品一区二区三区| 一本色道久久综合亚洲精品小说| 亚洲精品乱码久久久久久黑人| 在线日韩中文| 国产精品视频免费| 男女视频一区二区| 国产精品久久9| 1769国内精品视频在线播放| 国产午夜亚洲精品理论片色戒| 亚洲国产精品久久久久| 午夜精彩国产免费不卡不顿大片| 久久激五月天综合精品| 午夜国产精品视频| 亚洲国产欧美日韩精品| 欧美成人精品高清在线播放| 麻豆成人在线播放| 欧美激情1区| 一本久道综合久久精品| 欧美另类一区| 国产精品久久久久久久久久ktv| 久久免费精品日本久久中文字幕| 久久视频免费观看| 好看的日韩视频| 精品成人国产| 欧美区在线播放| 久久青草欧美一区二区三区| 国产精品午夜在线观看| 精品999在线播放| 欧美~级网站不卡| 亚洲一区二区三区四区五区午夜| 夜夜爽av福利精品导航| 麻豆91精品91久久久的内涵| 欧美在线日韩精品| 美乳少妇欧美精品| 亚洲性av在线| 午夜精品国产精品大乳美女| 久久精品视频在线| 午夜日韩电影|