Docstoc

25

Document Sample
25 Powered By Docstoc
					#include<fstream.h> #include<conio.h> void main() {int n; cout<<"cate numere vrei sa sortezi ? "<<endl; cin>>n; int i,gasit,man; long int numere[10]; ifstream f("nr.in"); for(i=1;i<=n;i++) f>>numere[i]; do {gasit=0; for(i=1;i<=n;i++) if(numere[i]>numere[i+1]){man=numere[i];numere[i]=numere[i+1];numere[i+1] =man;gasit=1;}} while(gasit); ofstream fo("nr.out"); for(i=1;i<=n;i++) fo<<numere[i]<<" ";}

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