This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package u4a2; | |
import u4a1.Stack; | |
public class IterativeAckermann { | |
/** | |
* Stack-based iterative implementation of the Ackermann function. | |
* | |
* @param n parameter n | |
* @param m parameter m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img style="display:block;margin-left:auto;margin-right:auto; width:80%;" src="http://lsglaufen.ch/wp-content/uploads/2015/11/logo_full.png" /> |
NewerOlder