Skip to content

Instantly share code, notes, and snippets.

View joennlae's full-sized avatar
🏗️

Jannis Schönleber joennlae

🏗️
View GitHub Profile
package u4a2;
import u4a1.Stack;
public class IterativeAckermann {
/**
* Stack-based iterative implementation of the Ackermann function.
*
* @param n parameter n
* @param m parameter m
public static String decrypt(String s) {
StringBuffer res = new StringBuffer();
for( int i = 0; i < s.length(); i++){
res.append((char)(s.charAt(i) - 3));
}
return res.toString();
}
// UNCOMMENT THE NEXT LINE TO ENABLE THE TESTS AND BEFORE SUBMITTING
//#include "tests.h"
#include <iostream>
#include <fstream>
#include <string>
char convertToChar(std::string a);
void runThroughString(std::string &a);
int main(){
std::cin >> std::noskipws;
@joennlae
joennlae / calendar.cpp
Created November 5, 2016 13:25
problem6
// UNCOMMENT THE NEXT LINE TO ENABLE THE TESTS AND BEFORE SUBMITTING
#include "tests.h"
#include <iostream>
// PRE: a year greater than 1900
// POST: returns whether that year was a leap year
bool is_leap_year(unsigned int year);
// PRE: a year greater than 1900
// POST: returns the number of days in that year
unsigned int count_days_in_year(unsigned int year);
// UNCOMMENT THE NEXT LINE TO ENABLE THE TESTS AND BEFORE SUBMITTING
//#include "tests.h"
#include <iostream>
using namespace std;
// PRE 0<= x < 2
// POST: return value is the binary representation of the inputed variable with 16 significant bits
void binExp(double dec);
int main(){
@joennlae
joennlae / .html
Created April 23, 2016 07:53
header.php wordpress
<img style="display:block;margin-left:auto;margin-right:auto; width:80%;" src="http://lsglaufen.ch/wp-content/uploads/2015/11/logo_full.png" />