Advertisement
catalyn

problema de pe 16.10.2014

Oct 16th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int minim (int a,int b)
  5. {
  6. int min=9999999,cif;
  7. while(a)
  8. {
  9. cif=a%10;
  10. if(cif<min)
  11. min=cif;
  12. a/=10;
  13. }
  14. return min;
  15. }
  16. void p(int a,int b)
  17. {
  18. int i;
  19. if(a>b)
  20. swap(a,b);
  21. for(i=1;i<=b;i++)
  22. cout<<i<<" ";
  23. }
  24. int main()
  25. {cout<<"a=";cin>>a;
  26. cout<<"b=";cin>>b;
  27. cout<<p(a,b);
  28.  
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement