Home test of code highlighting only
test of code highlighting only
> hello<-function() {
cat(paste("Hello, ",system("whoami",T),"!\n",sep="",collapse=""))
today<-as.list(unlist(strsplit(system("date",T)," ")))
names(today)<-c("weekday","month","day","time","timezone","year")
return(today)
}
#include <iostream>
using namespace std;
//! fibonacci numbers with gratuitous use of templates.
//! \param n an index into the fibonacci series
//! \param fib0 element 0 of the series
//! \return the nth element of the fibonacci series
template <class T>
T fib(int n, const T& fib0) {
T a(fib0), b(fib0);
while (--n >= 0) {
T tmp(a);
a += b;
b = tmp;
}
return a;
}
int main(int argc, char **argv) {
cout < < fib(10, 1U);
}
Leave a Reply