Advertisement
Tarche

A Divide B

Jun 7th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. //Lucas Hernán Tarche, 4to 4ta Turno Tarde, ESCCP
  2.  
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. bool esDivisor(int a, int b){
  8.     return (a % b == 0);
  9. }
  10.  
  11. int main(){
  12.     int a, b;
  13.     cin >> a >> b;
  14.     if (b == 0) {
  15.         cout << "b no puede ser cero";
  16.         return 1;
  17.     }
  18.     cout << a;
  19.     (esDivisor) ? cout << " divide a " : cout << " no divide a ";
  20.     cout << b << endl;
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement