updated scripts to create bin dir, dividableBy7 name change
This commit is contained in:
parent
0e95262ce0
commit
9e52cac031
29
7-teiler.c
29
7-teiler.c
|
@ -1,29 +0,0 @@
|
|||
/*
|
||||
* lower and upper end as user input
|
||||
* use a for loop to output all numbers for which 7|x is true.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
|
||||
int a,b;
|
||||
printf("input lower end:\n");
|
||||
fflush(stdin);
|
||||
scanf("%d",&a);
|
||||
printf("input upper end:\n");
|
||||
fflush(stdin);
|
||||
scanf("%d",&b);
|
||||
|
||||
printf("inputs: %d %d\n", a, b);
|
||||
for(int i=a; i<=b; i++){
|
||||
if(i%7==0)
|
||||
printf("%d ", i);
|
||||
if(i==b)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
// reverse array order
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
mkdir -p bin
|
||||
returnCode=0
|
||||
echo -e "compiling all files in working directory $(pwd)\n"
|
||||
for file in $(/bin/ls *.c);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
mkdir -p bin
|
||||
noext=$(echo "$1" | cut -f 1 -d '.')
|
||||
echo "compiling $1 ..."
|
||||
gcc $1 -o bin/$noext -lm
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
mkdir -p bin
|
||||
echo "compiling $1 ..."
|
||||
noext=$(echo "$1" | cut -f 1 -d '.')
|
||||
gcc $1 -o bin/$noext -lm
|
||||
|
|
Loading…
Reference in New Issue