Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
542e58c3f3 | |||
0368ff81cc | |||
c2662020b0 |
@ -11,6 +11,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Full history for git diff
|
||||||
|
|
||||||
- name: Prepare environment
|
- name: Prepare environment
|
||||||
id: setup
|
id: setup
|
||||||
@ -42,8 +44,9 @@ jobs:
|
|||||||
# Fallback to all .c/.bas files if no changes or no previous commit
|
# Fallback to all .c/.bas files if no changes or no previous commit
|
||||||
if [ -z "$CHANGED_FILES" ]; then
|
if [ -z "$CHANGED_FILES" ]; then
|
||||||
echo "=== Debug: No changes found; running fallback find ==="
|
echo "=== Debug: No changes found; running fallback find ==="
|
||||||
CHANGED_FILES=$(find . -type f \( -name "*.c" -o -name "*.bas" \) | head -1)
|
# Find newest .c/.bas by modification time (sort -nr on %T@ timestamp)
|
||||||
echo "Fallback files: '${CHANGED_FILES}'"
|
CHANGED_FILES=$(find . -type f \( -name "*.c" -o -name "*.bas" \) -printf '%T@ %p\n' 2>/dev/null | sort -nr | cut -d' ' -f2- | head -1)
|
||||||
|
echo "Fallback files (newest first): '${CHANGED_FILES}'"
|
||||||
echo "=== Debug: Fallback complete ==="
|
echo "=== Debug: Fallback complete ==="
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
6
jcl/SIEVE07.jcl
Normal file
6
jcl/SIEVE07.jcl
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
//SIEVE07 JOB (GCC),'Sieve 7 Example',
|
||||||
|
// NOTIFY=@05054,CLASS=A,MSGCLASS=H,
|
||||||
|
// MSGLEVEL=(1,1),REGION=4M,TIME=1440
|
||||||
|
//* Compile Step
|
||||||
|
//STEP1 EXEC GCCCG,INFILE='@05054.SRCLIB.C(SIEVE07)'
|
||||||
|
//
|
47
src/SIEVE07.c
Normal file
47
src/SIEVE07.c
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
#include<stdio.h>
|
||||||
|
|
||||||
|
#define LIMIT 10000
|
||||||
|
#define PRIMES 1000
|
||||||
|
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int i,j,numbers[LIMIT];
|
||||||
|
int primes[PRIMES];
|
||||||
|
|
||||||
|
for (i=0;i<LIMIT;i++)
|
||||||
|
{
|
||||||
|
numbers[i]=i+2;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i=0;i<LIMIT;i++)
|
||||||
|
{
|
||||||
|
if (numbers[i]!=-1)
|
||||||
|
{
|
||||||
|
for (j=2*numbers[i]-2;j<LIMIT;j+=numbers[i])
|
||||||
|
numbers[j]=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
j = 0;
|
||||||
|
for (i=0;i<LIMIT&&j<PRIMES;i++)
|
||||||
|
if (numbers[i]!=-1)
|
||||||
|
primes[j++] = numbers[i];
|
||||||
|
|
||||||
|
printf("\n");
|
||||||
|
printf("PRIME NUMBERS BETWEEN 1 AND %d\n",LIMIT);
|
||||||
|
printf("TOTAL PRIMES FOUND: %d\n\n",PRIMES);
|
||||||
|
printf("LIST OF PRIMES:\n\n");
|
||||||
|
|
||||||
|
for (i=0;i<PRIMES;i++)
|
||||||
|
if (i % 20 == 0)
|
||||||
|
{
|
||||||
|
printf("\n %4d ",primes[i]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("%4d ",primes[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user