Advertisement
Positive-

Skaitmenys

Jan 13th, 2016
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int findbiggest(int numb)
  6. {
  7.     int big=0;
  8.     while (numb!=0)
  9.     {
  10.         if (big<(numb%10)) big=numb%10;
  11.         numb/=10;
  12.     }
  13.     return big;
  14. }
  15.  
  16. int main()
  17. {
  18.     int a, b;
  19.  
  20.     cin >> a >> b;
  21.  
  22.     cout << "Didziausias A skaiciaus skaitmuo - " << findbiggest(a) << "\nDidziausias B skaiciaus skaitmuo - " << findbiggest(b);
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement