csansoon

P6.02 P84735 Smallest multiple

Nov 7th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5.  
  6. int main() {
  7.     int a,b,n=1;
  8.     while (cin>>a>>b) {
  9.         if (a%b!=0) a=((a/b)+1)*b;
  10.         cout<<"#"<<n<<" : "<<a<<endl;
  11.         n++;
  12.     }
  13.        
  14. }
Add Comment
Please, Sign In to add comment