Browse Source

Initial Commit

master
lunarised 5 years ago
commit
eb7d3b8bda
9 changed files with 69 additions and 0 deletions
  1. BIN
      99Bottles/99Bottles
  2. +28
    -0
      99Bottles/C99Bottles.c
  3. BIN
      99Bottles/a.out
  4. BIN
      Euler35/Euler
  5. +13
    -0
      Euler35/Euler35.c
  6. +22
    -0
      Fizzbuzz/FizzBuzz.c
  7. BIN
      Fizzbuzz/a.out
  8. +6
    -0
      HelloWorld/HelloWorld.c
  9. BIN
      HelloWorld/a.out

BIN
99Bottles/99Bottles View File


+ 28
- 0
99Bottles/C99Bottles.c View 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 View File


BIN
Euler35/Euler View File


+ 13
- 0
Euler35/Euler35.c View 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
- 0
Fizzbuzz/FizzBuzz.c View 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 View File


+ 6
- 0
HelloWorld/HelloWorld.c View 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 View File


Loading…
Cancel
Save