- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re:
- int a, b, smaller, sum=0;
- cout<<"請輸入第一個數: ";
- cin>>a;
- cout<<"請輸入第二個數: ";
- cin>>b;
- smaller=a<b?a:y;
- cout<<a<<"與"<<y<<"";
- for(int i=1; i<=n; i++)
- {
- if(n%i==0)
- {
- cout<<i<<" ";
- sum++;
- }
- }
- cout<<endl<<"總共有: "<<sum<<"個!!!"<<endl;
- cout<<endl<<"他們的總和為"<<sum<<"!!!"<<endl
- goto re;
- system("pause");
- return 0;
- }
複製代碼 |