URI / BEE CROWD 1073 - Even Square Solution in C,C++,Python | URI - BEECROWD - BEE 1073 Solution in C,C++,Python
beecrowd | 1073
Even Square
Adapted by Neilor Tonin, URI Brazil
Read an integer N. Print the square of each one of the even values from 1 to N including N if it is the case.
Input
The input contains an integer N (5 < N < 2000).
Output
Print the square of each one of the even values from 1 to N, as the given example.
Be carefull! Some language automaticly print 1e+006 instead 1000000. Please configure your program to print the correct format setting the output precision.
Input Sample | Output Sample |
6 | 2^2 = 4 |
URI / BEE CROWD 1073 - Even Square Solution in C,C++,Python | URI - BEECROWD - BEE 1073 Solution in C,C++,Python
Demonstration:
URI / BEE 1073 Solution in C :
URI / BEECROWD Online Judge 1073 Solve in C : |
#include<stdio.h>
int main()
{
int n,i;
scanf("%d",&n);
for(i=2;i<=n;i+=2)
{
printf("%d^2 = %d\n",i,i*i);
}
return 0;
}
0 Response to URI / BEE CROWD 1073 - Even Square Solution in C,C++,Python | URI - BEECROWD - BEE 1073 Solution in C,C++,Python
Post a Comment