update
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
unsigned long long explode(unsigned int m, unsigned short n);
|
||||
|
||||
int main(){
|
||||
printf("2* 2^n: %llu", explode(2,3));
|
||||
}
|
||||
|
||||
unsigned long long explode(unsigned int m, unsigned short n){
|
||||
return m << n; // n mal nach links shiften m*2^n
|
||||
}
|
||||
|
||||
struct Node {
|
||||
int data;
|
||||
struct Node *next;
|
||||
};
|
||||
Binary file not shown.
@@ -1,17 +0,0 @@
|
||||
//date.c
|
||||
|
||||
#include <stdio.h>
|
||||
#include "date.h"
|
||||
|
||||
struct date setInitDate(int year){
|
||||
struct date d;
|
||||
d.year = year;
|
||||
d.month = 1;
|
||||
d.day = 1;
|
||||
return d;
|
||||
}
|
||||
|
||||
void printDate(struct date * datum){
|
||||
printf("date: %d.%d.%d \n", datum->day, datum->month, datum->year);
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
// date.h
|
||||
|
||||
#ifndef DATE_H
|
||||
#define DATE_H
|
||||
|
||||
struct date{
|
||||
int day, month, year;
|
||||
};
|
||||
|
||||
struct date setInitDate(int year);
|
||||
void printDate(struct date *d);
|
||||
|
||||
#endif
|
||||
Binary file not shown.
@@ -1,28 +0,0 @@
|
||||
//highscore.c
|
||||
|
||||
#include "highscore.h"
|
||||
#include <stdio.h>
|
||||
|
||||
//define TEST
|
||||
#if defined TEST
|
||||
int main(){
|
||||
struct highscore hs;
|
||||
struct date datum = setInitDate(2077);
|
||||
int score = 9001;
|
||||
setHighscore(&hs, score, datum);
|
||||
printHighscore(&hs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void setHighscore(struct highscore *hs, struct date datum, int newscore){
|
||||
hs->date = datum;
|
||||
hs->score = newscore;
|
||||
}
|
||||
|
||||
void printHighscore(struct highscore * hs){
|
||||
printf(" Scores ab %d \n", firstYear);
|
||||
printf("your highscore: %d at date %d.%d.%d \n", hs->score, hs->date.day, hs->date.month, hs->date.year);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
// highscore.h
|
||||
|
||||
#include "date.h"
|
||||
|
||||
#ifndef HIGHSCORE_H
|
||||
#define HIGHSCORE_H
|
||||
|
||||
int firstYear;
|
||||
|
||||
struct highscore{
|
||||
struct date date;
|
||||
int score;
|
||||
};
|
||||
|
||||
void setHighscore(struct highscore * hs, struct date datum, int newscore);
|
||||
void printHighscore(struct highscore * hs);
|
||||
|
||||
#endif
|
||||
Binary file not shown.
@@ -1,28 +0,0 @@
|
||||
// rec_static.c
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void rec_out(int n);
|
||||
void decr(int n);
|
||||
|
||||
|
||||
int main(){
|
||||
rec_out(6);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void decr(int n){
|
||||
rec_out(--n);
|
||||
}
|
||||
|
||||
|
||||
void rec_out(int n){
|
||||
static int count = 1;
|
||||
printf("Die %d. Ausgabe.\n", count);
|
||||
count++;
|
||||
if (n > 1){
|
||||
decr(n);
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
#include "highscore.h"
|
||||
|
||||
int firstYear = 2000;
|
||||
|
||||
int main(){
|
||||
struct highscore hs;
|
||||
struct date datum = setInitDate(2077);
|
||||
int score = 9001;
|
||||
setHighscore(&hs, datum, score);
|
||||
printHighscore(&hs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user