Docstoc

27

Document Sample
27 Powered By Docstoc
					#include<fstream.h> #include<conio.h> int verifica(int numar) {int s,i; s=0; for(i=1;i<=numar/2;i++) if(numar%i==0)s=s+i; if(s==numar) return 1 ; else return 0 ;} void main() {ifstream f("numere.in"); ofstream fo("perfecte.out"); int x; while(f>>x) {if(verifica(x))fo<<x<<" ";} f.close(); fo.close();}


				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:17
posted:11/2/2008
language:
pages:1