Initial Commit
This commit is contained in:
commit
eb7d3b8bda
BIN
99Bottles/99Bottles
Executable file
BIN
99Bottles/99Bottles
Executable file
Binary file not shown.
28
99Bottles/C99Bottles.c
Normal file
28
99Bottles/C99Bottles.c
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
int rMethod(int _bottle){
|
||||||
|
if(_bottle > 1){
|
||||||
|
printf("%d bottles of beer on the wall!\n", _bottle);
|
||||||
|
printf("%d bottles of beer!\n", _bottle);
|
||||||
|
printf("You take one down, and pass it around!\n");
|
||||||
|
_bottle--;
|
||||||
|
printf("%d bottles of beer on the wall!\n", _bottle);
|
||||||
|
printf("\n");
|
||||||
|
rMethod(_bottle);
|
||||||
|
}
|
||||||
|
else if (_bottle == 1){
|
||||||
|
printf("%d more bottle of beer on the wall!\n", _bottle);
|
||||||
|
printf("%d more bottle of beer!\n", _bottle);
|
||||||
|
printf("Take it down, and pass it around!\n");
|
||||||
|
_bottle--;
|
||||||
|
printf("No more bottles of beer on the wall!\n");
|
||||||
|
}
|
||||||
|
else if (_bottle <= 0){
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
int main(void){
|
||||||
|
rMethod(10);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
BIN
99Bottles/a.out
Executable file
BIN
99Bottles/a.out
Executable file
Binary file not shown.
BIN
Euler35/Euler
Executable file
BIN
Euler35/Euler
Executable file
Binary file not shown.
13
Euler35/Euler35.c
Normal file
13
Euler35/Euler35.c
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
int main(void){
|
||||||
|
int i = 0;
|
||||||
|
int sum = 0;
|
||||||
|
int max = 15;
|
||||||
|
for (i=1;i<=max;i++){
|
||||||
|
if (i%3 == 0 || i%5 == 0){
|
||||||
|
sum = sum + i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("%d\n", sum);
|
||||||
|
return 1;
|
||||||
|
}
|
22
Fizzbuzz/FizzBuzz.c
Normal file
22
Fizzbuzz/FizzBuzz.c
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
int main(void){
|
||||||
|
int i = 1;
|
||||||
|
int max = 2048;
|
||||||
|
for (i=1;i<=max;i++){
|
||||||
|
if (i%3 == 0){
|
||||||
|
if (i%5 == 0){
|
||||||
|
printf("Fizzbuzz\n");
|
||||||
|
}else{
|
||||||
|
printf("Fizz\n");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (i%5 == 0){
|
||||||
|
printf("Buzz\n");
|
||||||
|
}else{
|
||||||
|
printf("%d\n", i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
BIN
Fizzbuzz/a.out
Executable file
BIN
Fizzbuzz/a.out
Executable file
Binary file not shown.
6
HelloWorld/HelloWorld.c
Normal file
6
HelloWorld/HelloWorld.c
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
int main(void){
|
||||||
|
printf("Hello World\n");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
BIN
HelloWorld/a.out
Executable file
BIN
HelloWorld/a.out
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user