3 solutions
- 1
Information
- ID
- 14
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 6
- Tags
- # Submissions
- 20
- Accepted
- 10
- Uploaded By
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a;
cin>>a;
for(int i=1;i<=a;i++)if(a%i==0)cout<<i<<endl;
}
C++ :
#include <iostream>
using namespace std;
int main() {
int a;
cin >> a;
for (int i = 1; i <= a; i++) {
if (a % i == 0) {
cout << i << endl;
}
}
}
By signing up a Hydro universal account, you can submit code and join discussions in all online judging services provided by us.