Sdut 1-2 outputs the sum of squares and cubes of N numbers (use of the tab "\ t)

Source: Internet
Author: User
1-2 output the sum of squares and cubes of N numbers Time Limit: 1000 ms memory limit: 65536 K Description

You can use this exercise to master the input and output methods of C ++.

Use the VC ++ development environment to create a console application. Use the CIN and cout statements to allow the program to output the corresponding sum of squares and cubes based on the input integer.

Input

An integer

Output

Consists of two parts, the first part occupies a row, and the output Header "numbersquarecube"; note that each item occupies the width of a tab (use "\ t" to control, "\ t" at the end of each line). The second part outputs the values, squares, and cubes of All integers from 1 to the input integer, each item in each row also occupies the width of a tab;

If the number of inputs is 0 or negative, only the header is output.

Sample Input
5
Sample output
NumberSquareCube111248392741664525125
Prompt Input 0
InputSample program from numbersquarecube


The main purpose of this question is not to solve this question, but to record the "\ t" tab used in this question!

# Include <iostream> using namespace STD; int main () {int N, I; CIN> N; cout <"numbersquarecube" <Endl; for (I = 1; I <= N; I ++) cout <I <"\ t" <I * I <"\ t" <I * I <"\ t" <Endl; // pay attention to the position where the tab "\ t" is used: Return 0 ;}


Sdut 1-2 outputs the sum of squares and cubes of N numbers (use of the tab "\ t)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.