This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
void main(int argc, char **argv) { | |
unsigned int n; // Input number | |
unsigned int n2; // Duplicate of input number to be worked with | |
int s = 0; // Shift counter | |
unsigned int a = 0; // Answer | |
unsigned int c = 0; // Carry number | |
n = atoi(argv[1]); // Read the first parameter provided and convert it to int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
# 2 constants: the square root of 2, and the raduis of the circle we're | |
# drawing. | |
ROOT_2 = sqrt(2) | |
RADIUS = float(1000000000) | |
# 2 variables: current x position, and the area of the circle being | |
# calculated. | |
x = RADIUS |
NewerOlder