summaryrefslogtreecommitdiff
path: root/hask-io/mini.c
diff options
context:
space:
mode:
Diffstat (limited to 'hask-io/mini.c')
-rw-r--r--hask-io/mini.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hask-io/mini.c b/hask-io/mini.c
new file mode 100644
index 0000000..eb5ba46
--- /dev/null
+++ b/hask-io/mini.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+int main(){
+ char buf[2048];
+ int a=0;
+ while(1){
+ size_t sz=fread(&buf,1,2048,stdin);
+ if(!sz)break;
+ for(size_t i=0;i<sz;i++){
+ a+=buf[i];
+ a%=256;
+ }
+ }
+ printf("%i\n",a);
+}