Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int edinici(int);
  5. int desetici(int);
  6. int stotici(int);
  7.  
  8. int main() {
  9. int a=837;
  10. cout<<"edinici "<<edinici(a)<<endl;
  11. cout<<"desetici "<<desetici(a)<<endl;
  12. cout<<"stotici "<<stotici(a)<<endl;
  13.  
  14. system ("pause");
  15. return 0;
  16. }
  17. int edinici(int a){
  18. return (a%100)%10;
  19. }
  20.  
  21. int desetici(int a){
  22. return (a/10)%10;
  23. }
  24.  
  25. int stotici(int a){
  26. return a/100;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement