Cod sursa(job #833833)

Utilizator stefania23ciocoiu stefania stefania23 Data 13 decembrie 2012 09:30:45
Problema Cifre Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.26 kb
#include<fstream.h>
ifstream f("cifre.in");
ofstream g("cifre.out");
int n,p,x;
int main(){
	f>>n;
	x=n;
	p=1;
	while(x>0){
		p=p*10;
		x=x/10;
	}
	p=p/10;
	while(n>0){
		x=n/p;
		n=n%p;
		p=p/10;
		g<<x<<' ';
	}
		g.close();
		return 0;
	}