日韩精品一区二区三区高清_久久国产热这里只有精品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>
        在线一区日本视频| 欧美日一区二区三区在线观看国产免| 欧美呦呦网站| 国产精品啊啊啊| 久久久久九九九九| 亚洲一区二区三区视频播放| 久久久久久97三级| 禁久久精品乱码| 亚洲国产女人aaa毛片在线| 欧美激情2020午夜免费观看| 欧美日本在线看| 一个色综合av| 一区二区不卡在线视频 午夜欧美不卡'| 亚洲在线中文字幕| 欧美国产三级| 国产亚洲一区二区在线观看| 久久婷婷亚洲| 欧美三级电影一区| 欧美日韩妖精视频| 香蕉乱码成人久久天堂爱免费| 国产精品久久久久久户外露出| 99亚洲一区二区| 久久精品视频99| 亚洲高清自拍| 欧美岛国激情| 欧美激情国产精品| 欧美亚洲综合另类| 欧美日韩在线视频一区二区| 欧美理论电影在线播放| 亚洲图片欧洲图片日韩av| 亚洲欧洲日夜超级视频| 国产麻豆精品视频| 国产精品一区二区你懂的| 午夜精品久久久| 欧美日韩精品三区| 欧美精品999| 久久婷婷国产麻豆91天堂| 国产一区二区无遮挡| 欧美va亚洲va香蕉在线| 久久婷婷麻豆| 欧美日本精品在线| 国产精品女同互慰在线看| 在线观看欧美| 欧美凹凸一区二区三区视频| 日韩一级在线观看| 一区二区三区免费看| 欧美性猛交视频| 亚洲制服丝袜在线| 欧美午夜在线| 国产情人节一区| 在线看片成人| 在线免费观看日本一区| 欧美美女喷水视频| 亚洲精品少妇| 欧美激情第二页| 国产精品高潮久久| 一本久久精品一区二区| 伊人久久综合97精品| 欧美电影在线观看| 亚洲激情成人在线| 中文在线资源观看视频网站免费不卡| 欧美精品一卡二卡| 国产中文一区二区| 日韩视频第一页| 一区二区不卡在线视频 午夜欧美不卡在| 一道本一区二区| 亚洲大胆在线| 亚洲国产精品成人综合色在线婷婷| 欧美另类99xxxxx| 一区二区三区四区精品| 欧美电影资源| 国产精品草莓在线免费观看| 美国十次了思思久久精品导航| 国产一区二区成人久久免费影院| 一本到12不卡视频在线dvd| 国产精品久久久久久久久借妻| 欧美成人性网| 欧美日本不卡高清| 欧美日韩在线电影| 国产日韩精品在线观看| 国产午夜精品久久| 欧美成人四级电影| 这里只有精品在线播放| 国产精品美女黄网| 国产日韩精品视频一区二区三区| 欧美一级视频一区二区| 欧美日韩在线精品一区二区三区| 中文久久乱码一区二区| 老司机精品视频网站| 亚洲日本成人在线观看| 国内免费精品永久在线视频| 一区二区三区www| 欧美日韩午夜在线| 亚洲国产一区二区在线| 国产日韩一区二区三区在线| 亚洲欧美日韩电影| 尤物99国产成人精品视频| 国产欧美精品日韩区二区麻豆天美| 欧美精品激情blacked18| 国产区亚洲区欧美区| 在线视频一区二区| 在线不卡免费欧美| 极品日韩久久| 欧美1区2区3区| 欧美另类极品videosbest最新版本| 亚洲综合电影一区二区三区| 美国十次了思思久久精品导航| 在线播放日韩| 亚洲欧洲精品一区| 亚洲精品一区在线| 欧美激情一区二区三区不卡| 国产日韩欧美91| 一区二区三区高清在线| 亚洲精品日韩在线观看| 亚洲欧美在线aaa| 亚洲成人在线网站| 久久深夜福利免费观看| 亚洲精品综合久久中文字幕| 欧美中日韩免费视频| 国产精品九九久久久久久久| 久久久久国产精品麻豆ai换脸| 久久综合国产精品| 中国女人久久久| 久久精品99无色码中文字幕| 久久三级视频| 狂野欧美激情性xxxx欧美| 午夜精品成人在线视频| 国产精品推荐精品| 亚洲精品四区| 亚洲一二三区精品| 国产一二三精品| 国产精品美女久久久久aⅴ国产馆| 国产一区二区三区在线播放免费观看| 亚洲永久在线观看| 欧美婷婷在线| 国产一区再线| 亚洲日本视频| 在线免费观看日韩欧美| 欧美色偷偷大香| 国产精品私拍pans大尺度在线| 精品动漫一区二区| 久久久国产精彩视频美女艺术照福利| 欧美www视频在线观看| 国产视频久久| 亚洲第一天堂无码专区| 狠狠色综合网| 欧美性一二三区| 欧美成人网在线| 国产精品专区h在线观看| 国产欧美一区视频| 亚洲在线观看视频| 噜噜噜在线观看免费视频日韩| 欧美日本一区二区高清播放视频| 欧美国产一区视频在线观看| 亚洲——在线| 午夜一区二区三区在线观看| 国产精品女主播一区二区三区| 亚洲欧洲一二三| 国产亚洲激情| 亚洲自拍电影| 国产精品r级在线| 国产在线精品自拍| 欧美视频免费在线观看| 亚洲欧洲在线观看|