讲解:C++100-999 CMPSC 101C/C++

IntroductionRequirementCMPSC 101 Due: January 30, 2017Spring 2017Problem Set 2Each program source file must have, at the beginning of the program, a “banner comment” of the following form.://———————————————————-// Name:// E-mail Address:// Class: CMPSC 101// Project #// Due Date:// Brief Project Description//———————————————————-Your programs should include appropriate comments and should follow the program documentation requirements listed in the syllabus.(15 points) Write a program thC++代写计算一个100-999的三位数 CMPSC 101代做C/C++实验at prompts the user to enter an integer number between 0 and 1000 and adds all the digits in the integer. For example, if an integer is 932, the sum of all its digits is 14.Hint: Use the % operator to extract digits, and use the / operator to remove the extracted digit. For instance, 932%10 is 2 and 932/10 is 93.Here is a sample run:Enter an integer number between 0 and 1000: 999The sum of the digits is 27.Submission Instruction:• Submit your source file via Angel by the beginning of the class on January 30, 2017.• Hardcopy submission is due at the beginning of the class on January 30, 2017.• You only need to submit your source code file (.cpp).• See the course syllabus for more detailed information on how to submit your work.& 转自:http://ass.3daixie.com/2018060913919961.html

你可能感兴趣的:(讲解:C++100-999 CMPSC 101C/C++)