Procházet zdrojové kódy

Initial Commit

master
lunarised před 5 roky
revize
eb7d3b8bda
9 změnil soubory, kde provedl 69 přidání a 0 odebrání
  1. binární
      99Bottles/99Bottles
  2. +28
    -0
      99Bottles/C99Bottles.c
  3. binární
      99Bottles/a.out
  4. binární
      Euler35/Euler
  5. +13
    -0
      Euler35/Euler35.c
  6. +22
    -0
      Fizzbuzz/FizzBuzz.c
  7. binární
      Fizzbuzz/a.out
  8. +6
    -0
      HelloWorld/HelloWorld.c
  9. binární
      HelloWorld/a.out

binární
99Bottles/99Bottles Zobrazit soubor


+ 28
- 0
99Bottles/C99Bottles.c Zobrazit soubor

@@ -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ární
99Bottles/a.out Zobrazit soubor


binární
Euler35/Euler Zobrazit soubor


+ 13
- 0
Euler35/Euler35.c Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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ární
Fizzbuzz/a.out Zobrazit soubor


+ 6
- 0
HelloWorld/HelloWorld.c Zobrazit soubor

@@ -0,0 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
printf("Hello World\n");
return EXIT_SUCCESS;
}

binární
HelloWorld/a.out Zobrazit soubor


Načítá se…
Zrušit
Uložit