URI / BEE CROWD 1143 - Squared and Cubic - Solution in C,C++,Python | URI - BEECROWD - BEE 1143 Solution in C,C++,Python

URI / BEE CROWD 1143 - Squared and Cubic - Solution in C,C++,Python | URI - BEECROWD - BEE 1143 Solution in C,C++,Python

                                                                                             beecrowd | 1143

Squared and Cubic

Adapted by Neilor Tonin, URI  Brazil

                                                                                             Timelimit: 1


URI / BEE CROWD 1143 - Squared and Cubic - Solution in C,C++,Python | URI - BEECROWD - BEE 1143 Solution in C,C++,Python :

Write a program that reads an integer N (1 < N < 1000). This N is the number of output lines printed by this program.

Input

The input file contains an integer N.

Output

Print the output according to the given example.

Input SampleOutput Sample

5

1 1 1
2 4 8
3 9 27
4 16 64
5 25 125

N.B: Don't copy paste the code as same. Just try to understand it and try yourself.

  URI / BEE 1143 Solution in C :   

  URI / BEECROWD Online Judge 1143 Solve  in C :                                          

#include<stdio.h>

int main(){

        int N,i;
        scanf("%d", &N);
       
        for(i = 1; i <= N;i++){
            printf("%d %d %d\n",i,i*i,i*i*i);
        }
     return 0;
}

0 Response to URI / BEE CROWD 1143 - Squared and Cubic - Solution in C,C++,Python | URI - BEECROWD - BEE 1143 Solution in C,C++,Python

Post a Comment