Mercurial > cgi-bin > hgwebdir.cgi > PR > Applications > SSR > SSR__Sieve__Bench
annotate src/Application/main.c @ 0:8194b72c6c30
initial import
| author | hausers |
|---|---|
| date | Wed, 30 Nov 2011 16:56:25 +0100 |
| parents | |
| children |
| rev | line source |
|---|---|
| hausers@0 | 1 #include <stdio.h> |
| hausers@0 | 2 #include <stdlib.h> |
| hausers@0 | 3 #include "SievePrints.h" |
| hausers@0 | 4 #include "SSR_Sieve/SSR_Sieve.h" |
| hausers@0 | 5 |
| hausers@0 | 6 char __ProgrammName[] = "Sieve of Eratosthenes"; |
| hausers@0 | 7 char __DataSet[255]; |
| hausers@0 | 8 |
| hausers@0 | 9 int main (int argc, char**argv) { |
| hausers@0 | 10 char* primeNumbers; |
| hausers@0 | 11 int n; |
| hausers@0 | 12 if (argc != 2) { |
| hausers@0 | 13 printf("Argument n expected!\n"); |
| hausers@0 | 14 return 1; |
| hausers@0 | 15 } |
| hausers@0 | 16 n= atoi(argv[1]); |
| hausers@0 | 17 primeNumbers= computePrimeNumbers(n); |
| hausers@0 | 18 printPrimes(primeNumbers,n,0); |
| hausers@0 | 19 return 0; |
| hausers@0 | 20 } |
