[ prog / sol / mona ]

prog


Marvin Minsky - The Beauty of the Lisp Language

48 2020-10-07 00:50

>>47
Alternative
#include <stdio.h>
int main(){
#define sum(i,acc) acc+=i
#define loop(x,y,acc,func) ({for(int i=x;i<=y;i++){func(i,acc);}acc;})
#define sumloop(x,y) ({int acc=0;loop(x,y,acc,sum);})
printf("%d",sumloop(1,10));
}

301


VIP:

do not edit these