Skip to content

Instantly share code, notes, and snippets.

@hansen033
Created October 19, 2017 14:09
Show Gist options
  • Save hansen033/d2a4e621f6ffd69b38209e5ffe2002ca to your computer and use it in GitHub Desktop.
Save hansen033/d2a4e621f6ffd69b38209e5ffe2002ca to your computer and use it in GitHub Desktop.
2017.10.05
#include <iostream>
using namespace std;
int main()
{
int a, b;
cout <<"判斷a是否為b的倍數\n";
cout <<"\n請輸入a:";
cin >> a;
cout <<"請輸入b:";
cin >> b;
if (a%b==0){
cout<< "\n" << a << "是" << b << "的倍數";
}else{
cout<< a << "不是" << b << "的倍數";
}
cout <<"\n\n謝謝使用";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment