add clang

This commit is contained in:
Dawid Sobczak 2025-04-18 12:38:54 +01:00
parent 4715742aa8
commit 9a4b261179
890 changed files with 229323 additions and 20 deletions

View file

@ -0,0 +1,27 @@
#include <stdio.h>
typedef struct
{
double average;
int count;
}
stats_type;
static void
testc (stats_type *s, long long data)
{
s->average = (s->average * s->count + data) / (s->count + 1);
s->count++;
}
int main (void)
{
stats_type s;
s.average = 0;
s.count = 0;
testc (&s, 10);
testc (&s, 20);
printf ("%g %d\n", s.average, s.count);
return 0;
}