Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
better o/p of factor problem
#include <bits/stdc++.h> using namespace std; int main() { vector<int>rahul; int n; cout<<"Enter the total no that you want to factor of: "<<endl; cin>>n; cout<<"Enter the numers you wnt to factor:"<<endl<<endl; for(int i=0;i<n;i++) {int x;cin>>x;rahul.push_back(x);} for(int j=0;j<n;j++) { cout<<"factor of "<<rahul[j]<<" is: "; for(int k=*max_element(rahul.begin(),rahul.end());k>=1;k--) { if(rahul[j]%k==0) cout<<rahul[j]/k<<" "; } cout<<endl; } return 0; }
run
|
edit
|
history
|
help
1
VecHotel3
Smalllest subarray wiith sum greater than x
MyStack
insertion_sort
LIS_NEW
pointer
candies
mytemp
stlsizeof.cc
References Pt 1 C++