Initial commit

This commit is contained in:
2021-10-01 20:24:05 +02:00
commit 860c025165
194 changed files with 4846 additions and 0 deletions

34
kapitel15/matte/matte.c Normal file
View File

@@ -0,0 +1,34 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "minmattefunk.h"
#include "usage.h"
int main(int argc, char **argv)
{
int opt;
if (argc == 1)
{
printUsage(argv[0]);
return 1;
}
while ((opt = getopt(argc, argv, "s:c:")) != -1)
{
switch (opt)
{
case 's':
printf("%d squared is %d\n", atoi(optarg),
kvadrat(atoi(optarg)));
break;
case 'c':
printf("%d cubed is %d \n", atoi(optarg),
kubik(atoi(optarg)));
break;
default:
printUsage(argv[0]);
return 1;
}
}
return 0;
}