Advertisement
alexon5519

19-programare

Feb 26th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main(){
  8. ifstream f1("atestat.in");
  9. ofstream f2("atestat.out");
  10. int n,v[30],i=0,x,m;
  11. f1>>n;
  12. while(f1>>x){
  13. i++;
  14. v[i]=x;
  15. }
  16. for(i=n;i>=1;i--)
  17. f2<<v[i]<<" ";
  18. f2<<endl;
  19. for(i=1;i<=n;i++){
  20. x=v[i];
  21. m=0;
  22. while(x!=0){
  23. m++;
  24. x=x/10;
  25. }
  26. f2<<m<<" ";
  27. }
  28. f1.close();
  29. f2.close();
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement