Docstoc

13

Document Sample
13 Powered By Docstoc
					#include<iostream.h> #include<conio.h> #include<fstream.h> fstream f("numere.in", ios::in); fstream g("prime.out", ios::out); int prim(int n) { for(int i=2;i<=n/2;i++) if(n%i==0) return 0; return 1 ; } void main() {clrscr(); int x; while(f>>x) {if(prim(x)){g<<x<<" "; cout<<x<<" ";}} getch();}


				
DOCUMENT INFO
Shared By:
Tags:
Stats:
views:20
posted:10/30/2008
language:Japanese
pages:1
Olanescu Ana Maria Olanescu Ana Maria
About